Mail Archives: djgpp/1998/03/13/20:24:48
At 05:17 3/12/1998 GMT, A. Jans-Beken wrote:
>shifter wrote:
>>
>> #include <stdio.h>
>>
>> main()
>> {
>> char *i;
>> char *password;
>
>OOPS----^^^^^^^^
>password is a pointer but points to nothing.
>char *password = "xxxxxxxxxxxxxxxxxx"; works...
No it won't! You may get away with it on DJGPP, but on most systems a string
constant will be read-only. Setting a pointer to point to a constant and
then writing into it will get you only a nice message saying "Segmentation
fault".
Nate Eldredge
eldredge AT ap DOT net
- Raw text -