Code:
scanf("%[^\n]",line);
and how this statement works...
i know that this statement inputs lines till enter is pressed..
but what is the format of the scanf statements please tell...
|
Invasive contributor
|
![]() |
| 24Mar2010,11:58 | #1 |
|
Code:
scanf("%[^\n]",line);
and how this statement works... i know that this statement inputs lines till enter is pressed.. but what is the format of the scanf statements please tell... |
|
Go4Expert Member
|
|
| 24Mar2010,12:23 | #2 |
|
It is equal to gets . By default scanf will read the input until it receives a word separator ( space,tab,etc ).
We can change that to some character . Here you changed to read until the new line ( Read the characters other than '\n' .If '\n' it will get end ) . |