- Oct 22, 2003
- 204
- 0
- 0
INPUT FILE
String p c d f e b p s
String c c 3 d 4 f j l
I am trying to parse this file in C
Here is the basic of my code
while(fscanf(fin, "%s", buffer)!=EOF)
{
if(strcmp(buffer, "String")==0)
{
while(strcmp(buffer, "\n"){
fscanf(fin, "%s", buffer)
createNode("buffer"); // Creates a node using the buffer as the name.
}
}
}
I am having a hard getting the input to recognize the newline character, and for it to stop at end of the line.
String p c d f e b p s
String c c 3 d 4 f j l
I am trying to parse this file in C
Here is the basic of my code
while(fscanf(fin, "%s", buffer)!=EOF)
{
if(strcmp(buffer, "String")==0)
{
while(strcmp(buffer, "\n"){
fscanf(fin, "%s", buffer)
createNode("buffer"); // Creates a node using the buffer as the name.
}
}
}
I am having a hard getting the input to recognize the newline character, and for it to stop at end of the line.