
12-10-2009, 14:49
|
 |
|
|
חבר מתאריך: 04.08.02
הודעות: 4,468
|
|
You really don't want to input a string using scanf.
You should input a string using fgets, and to answer your question:
Reads characters from stream and stores them as a C string into str until (num-1) characters have been read or either a newline or a the End-of-File is reached, whichever comes first.
A newline character makes fgets stop reading, but it is considered a valid character and therefore it is included in the string copied to str.
A null character is automatically appended in str after the characters read to signal the end of the C string.
_____________________________________
C pogrammers never die. They are just cast into void.
|