Stupar Andrija
2004-02-06 01:41:16 UTC
I have a little problem using fscanf. Now the cnf files all begin with "p
cnf". I declare a string char fileheader[6]; and then use the following
command when reading the file:
fscanf(fs,"%s %d %d", fileheader, &numvariables, &numclauses);
Now this always gives me just "cnf" rather than "p cnf". I've tried
reading in a character (or 2) before the string, but I still just get
"cnf" that, is the "c" goes into the character while the string becomes
"nf". Does anyone know what is going on here?
Thanks
cnf". I declare a string char fileheader[6]; and then use the following
command when reading the file:
fscanf(fs,"%s %d %d", fileheader, &numvariables, &numclauses);
Now this always gives me just "cnf" rather than "p cnf". I've tried
reading in a character (or 2) before the string, but I still just get
"cnf" that, is the "c" goes into the character while the string becomes
"nf". Does anyone know what is going on here?
Thanks