Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Program won't crash when it should

Name: Anonymous 2012-01-16 3:24

(GCC C)
I ran a pointer over each member of an integer array, storing one character of input in each cell.

The program seems to consistently crash when I try to store X+3 or more characters, where X is the size of the array, but if I do not exceed X+2 it will not crash.

Why does it crashes exactly at the point it does, but not for X+1 or X+2?

Name: kodak_gallery_programmer !!HfslGqyCdtdPesq 2012-01-16 19:05

have the compiler terminate on any undefined behavior, thus it will generate no output.

Let's say I have something like the following..

#include <stdio.h>

int main(void)
{
  (void)printf("Hello");
  return 0;
}

This program has undefined behavior. How do you propose that I have the program terminate in this case?

Name: Anonymous 2012-01-16 19:14

>>41
So how would the compiler terminate the program in this case?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List