Re: Segmentation Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



K. Srinivasa Chary wrote:
 char *s="",t;

...
 scanf("%s",s);
You haven't really provided a place for scanf to store its output.

char *s="";

Makes s equal to a pointer to a single byte of 0 stored somewhere in memory (potentially shared with "" or even other strings elsewhere in your program). It is NOT a buffer you are permitted to overwrite.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux