Re: gets() function generates strong warning message with gcc compiler
spibou@xxxxxxxxx wrote:
paytam@xxxxxxxxx wrote:
while((ch=getchar())!='\n')
You also need to check for EOF.
So you would need to declare ch as int rather than
char.
.
Relevant Pages
- Re: scanf behaviour
... char, i have to reread the input until I get the needed pos. ... user input a number that's too large to be stored in an integer. ... static int ignoreblks ... which may be \n or EOF ... (comp.lang.c) - Re: memory leak?
... char, short, int are all 16 bits. ... them rely on EOF being returned by the function. ... value distinct from all unsigned char values. ... (microsoft.public.vc.mfc) - Re: Is there any GENRIC MACROS in c for INTEGERS,CHARACTERS ?
... >> The descriptions of the ctype functions all take int values. ... >> that char is converted to int in this case and that if char is signed ... What is EOF for in this context? ... the 'space' characters and so 0 must be the result. ... (comp.lang.c) - Re: huffman encoder
... > to the specified stream and advances the position indicator for the ... > the error indicator for the stream is set and EOF is returned. ... the whole damn int does not go to the file, only the byte value of the int. ... flushing the, eg, so the last char is not truncated. ... (comp.compression) - Re: huffman encoder
... > to the specified stream and advances the position indicator for the ... > the error indicator for the stream is set and EOF is returned. ... the whole damn int does not go to the file, only the byte value of the int. ... flushing the, eg, so the last char is not truncated. ... (comp.compression) |
|