Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~485 People Reached
Favorite Forums
Favorite Tags
c++ x 6
c x 4
Member Avatar for cocojim

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++.

Member Avatar for WolfPack
0
30
Member Avatar for cocojim

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 …

Member Avatar for WolfPack
0
220
Member Avatar for cocojim

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: …

Member Avatar for cocojim
0
235