When compiling with Borland C it worked fine. However when I tried cimpiling it with VS 2005 I got the following error:
"Unhandled exception at 0x00413529 in Learning C.exe: 0xC0000005: Access violation writing location 0x00415645."
But based on what I learnt in C I don't understand why it did not work in VS. And why by making it an array rather than a pointer it made a difference?
char *name=
"Yankee Duddle"; is a constant, it can not be modified.
char name[]=
"Yankee Duddle"; the elements can be modified.
calling the SET_BIT in main you are trying to modify the value in char *name.
[EDIT]: Sorry,
SPS your posted while I was writing this. Making this post a repetition.
Last edited by Aia; Aug 19th, 2007 at 1:35 pm.
Reputation Points: 2224
Solved Threads: 218
Nearly a Posting Maven
Offline 2,304 posts
since Dec 2006