I've tried to run the following code in netbeans 7 in ubuntu ...
build successful 194 ms, run failed 487ms
directly tried on gcc from terminal, segmentation fault, but works fine in Dev C++ in MS Windows. Somebody please explain why....
#include <stdio.h>
#include <stdlib.h>
/*
*
*/
int main(int argc, char** argv) {
char *s = "hello, world";
char *t, *temp=t;
while(*t++=*s++);
while(*temp)
printf("%c", *temp++);
return (EXIT_SUCCESS);
}
Bookmarks