Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8253409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:52:00+00:00 2026-06-08T00:52:00+00:00

seriously.. I’m an old hacker from the 80’s and with some spare time on

  • 0

seriously..
I’m an old hacker from the 80’s and with some spare time
on my hands thought I’d ‘C’ what the fuss is about

( my background is Forth, which does things back to front
so I learn a lot about forcing lots of errors )

In this case I’ve set up a small array which I
thought would be 3 elements in size ( 0,1,2 )

If I run the compilation, I would have thought
I’d have got an out-of-bounds error, but no-
it compiles ok and runs sweetly

No great hurry on this one, but it’s
not good for the little bald spot, all that scratchin’.


int main()
{
    char members[3][16];  // 3 elements, each 15 char long plus null

    printf("\n enter something..  ");
    scanf( "%s", members[4]);

    printf("\n and something else..  ");
    scanf( "%s", members[5]);

    printf(" %s  ", members[4]);
    printf(" %s\n", members[5]);

    return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:52:01+00:00Added an answer on June 8, 2026 at 12:52 am

    C doesn’t do any bounds checking. (Forth doesn’t either, so I’m not sure where the expectation came from.)

    Overflowing an array is undefined behavior: it is allowed, but not required, to crash. In this case, the bytes just happen to be in the same virtual memory page as the stack frame where the local variable was placed. If the frame were towards the end of the page, the CPU would recognize a bad address and complain about the overflow.

    If you go a few kilobytes or megabytes out, you will likely see something like you expect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seriously, it seems like every time I want to make my UI elements talk
Probably I cant get more dumb, but seriously this is the first time I
Seriously i've been looking for weeks, even months for some serious help with OpenGl
I'm seriously confused about the concept of the 'Model' in MVC. Most frameworks that
Seriously Parse error: syntax error, unexpected '<' on line 22 Code snippet from line
A seriously flawed and retarded piece of software which goes by the name of
How seriously do developers think about using a 16bit integer when writing code? I've
I seriously cant understand why this is so hard... I have some experience with
I am seriously confused about the Objective-C #import. I searched and found several tutorials
I'm seriously about to stop coding and become a carpenter. This problem has had

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.