Tuesday, July 14, 2009

In C, how are spaces entered in strings entered from user?

[%s in scanf does not consider spaces]

In C, how are spaces entered in strings entered from user?
you can read a whole line with fgets
Reply:Use "gets"... but you will have to parse the string yourself.





#
Reply:Use gets( char * ), gets reads until a newline is found. Note that the newline (\n) is not returned in the string.


No comments:

Post a Comment