No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
3 Posted Topics
what is wrong with the following simple code? [code] int *n; int a=1; n=&a; cout <<"n="<<*n<<"\n"; [/code] It compiles, but print out "Bus Error". I am compling this code under Mac OS X, Unix shell, g++. | |
Rookie Disclaimer. I am confused about what is the difference between: A: char *p="string"; B: char q[10]="string"; For A: I can do "p++", which gives a pointer points to "t". But I cannot do command like "strcat(p, " test")", for example. For B: I can do "strcat(q, " test")", but … | |
I was trying to implement "strcat" myself, however, I found that the following commands simply won't work: "..... char *p; p="string"; *(p+2)=a; " I was thinking that this will change "p" to "staing". But no. It compilies fine, but when I tried to print out p, i got error message: … |
The End.