mobile-it
Advanced Member level 1
#include <stdio.h>
int main(void){
char string[] = "hello\n";
char *p;
char *q;
q = string;
while(*p++=*q++)
;
printf("%s\n",q);
printf("%s\n",p);
return 0;
}
I get a segmentation fault when I try to run this program on ubuntu linux after compiled with gcc anyone knows the problem? I want to use this
instruction
thanks
int main(void){
char string[] = "hello\n";
char *p;
char *q;
q = string;
while(*p++=*q++)
;
printf("%s\n",q);
printf("%s\n",p);
return 0;
}
I get a segmentation fault when I try to run this program on ubuntu linux after compiled with gcc anyone knows the problem? I want to use this
Code:
while(*p++=*q++)
;
thanks