Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C Moderated > scanf behaviour
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 1064 of 1099
Post > Topic >>

scanf behaviour

by "azhar084@[EMAIL PROTECTED] " <azhar084@[EMAIL PROTECTED] > Mar 17, 2008 at 03:22 PM

I am novice in C programming.

i have to read a record from file which looks like
c|string1|string2$c|string1|string2$

I am trying to read using fscanf like
fscanf(fp,"%c|%[^|]s%[^$]s",&ch,string1,string2);

but im not getting c ,string1,string2

after playing around for some time I changed my fscanf to

fscanf(fp,"%c|%[^|]%c[^$]s",&ch,string1,string2);

which read successfully

can anybody help me out what's happening

Thanks in advance
-- 
comp.lang.c.moderated - moderation address: clcm@[EMAIL PROTECTED]
 -- you must
have an appropriate newsgroups line in your header for your mail to be
seen,
or the newsgroup name in square brackets in the subject line.  Sorry.




 1 Posts in Topic:
scanf behaviour
"azhar084@[EMAIL PRO  2008-03-17 15:22:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 17:16:17 CDT 2008.