From: "Smith A. Cat" Newsgroups: comp.os.msdos.djgpp Subject: why does this work like this (char allocation question)?? Date: 13 Aug 1997 20:08:00 -0700 Organization: Blue Square Laboratories Lines: 21 Message-ID: <33EC75ED.2EA9@primenet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk when i run this: #include char buffer[4]; void main(void){ printf("%s %d", gets(buffer), sizeof(buffer)); } for an input string up to about 64 characters (i'm not sure how many due to impatience...) it echos the input string, and prints *4* for the size. when the string gets longer, it segs out. why doesn't it seg out as soon as the string exceeds four characters?? the same thing happens if you declare the string as a pointer (*buffer). does a declared variable name automagically get 64 bytes of exercise space?? phil