Monday, July 9, 2007

How to scan a string till we hit a new line using scanf()?

Use



scanf("%[^\n]", address);

7 comments:

Anonymous said...

awesome..

Anonymous said...

its called edit set conversion code can also use gets

Anonymous said...

Why does Anonymous have to comment for every code written here/

Anonymous said...

gets(string);

this will do d same thing....

Anonymous said...

gets will read the \n which is sometimes not wanted

Anonymous said...

Thanks for the info. It is very helpful.
RegardsEducational site
Get jobs info at Educational site

Anonymous said...

Hello mates, how is all, and what you desire to say regarding this article, in my view its actually awesome for me.


Here is my page: waist height ratio