9.0 slackware lib problem
I am trying to build a compiler and I was trying to read some clear text into string arrays. The lib function is fgets. as I am reading in the file I print the strings. This works just fine. After it finishes, inside the routine, I try to print the strings before I exit, and they are gabled. in fact, it prints ALL of the strings overlaid.
I read a clear text file with fgets. No tricks, no extra code. I read 350 lines.
I noticed that printf( " %s \n" has 2 nl chars. (?) I think one is in the input string. but the documentaion says the strings are \0 delimted. The problem with the strings is there does not seem to be any \0 delimiters.
can someone tell me how to fix this? I even malloc everything. No clues for me in the docs..
josephus
|