By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,376 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

What is the function of "%[^\n]" in a scanf?

P: n/a
this is the statement i encountered . . .

Expand|Select|Wrap|Line Numbers
  1. fscanf(fp,"%[^\n]",str1);
where str1 is a str1[80]

can someone please unconfuse me on whats the difference between using a %c and a %[6\n] in reading strings ? thanks
Oct 20 '10 #1
Share this Question
Share on Google+
1 Reply


100+
P: 687
This one scans tabs and spaces - see http://linux.die.net/man/3/scanf
Oct 20 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.