D
David Scarlett
A couple of questions...
Firstly, can I put an expression inside an array definition?
eg.
char ln[MAX_LINE_LEN+1]; /* MAX_LINE_LEN has been #defined */
Secondly, is the size of a char always 1 byte?
ie. To get a line from stdin, can i do this, assuming the above
definition of 'ln'?
fgets( ln, sizeof(ln), stdin );
Or do I have to do this?
fgets( ln, sizeof(ln)/sizeof(char), stdin );
Thanks.
Firstly, can I put an expression inside an array definition?
eg.
char ln[MAX_LINE_LEN+1]; /* MAX_LINE_LEN has been #defined */
Secondly, is the size of a char always 1 byte?
ie. To get a line from stdin, can i do this, assuming the above
definition of 'ln'?
fgets( ln, sizeof(ln), stdin );
Or do I have to do this?
fgets( ln, sizeof(ln)/sizeof(char), stdin );
Thanks.