Hello,

The following program is behaving differently when executed directly
and within gdb. While the direct execution seg faults, within gdb, it
says that the program exited normally. Am I missing something here? The
program must seg fault - I checked it in VC++ also. How is it that gdb
says program exited normally?

#include <iostream>

int main()
{
  char *p="hi friends",*p1;
  p1=p;
  while(*p!='\0') ++*p++;
  std::cout << p1; 
  return 0; 
}

TIA
Srini

_______________________________________________
Help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to