After the file read, I'm using fscanf(filename , "%i,%c,%i,%c,%i ",&hours,&colon ,&minutes,&colo n,&seconds);
with just the time on a line in the text file and the only thing being read in is the hours, the minutes and seconds end up as zero.
--- nevermind this post-- I figurred it out, Thakns for the help.
User Profile
Collapse
-
The data for the time is in hh:mm:ss.ss format, yes, for example, 12:15:20.57 would be 12:15 and 20.57 seconds. The secondsPastHour needs to be a float. Also, the two data fields are both floats.
How can I read in an int and have it stop at the colon? Can you just give me a quick code snippet of this? I can't figure out which read routine is best for it.
Thanks.Leave a comment:
-
read text file into formatted struct array
Hello,
I have a text file of unknown size that I need to read into a struct array where the struct looks like :
{
short hours
float secondsPastHour
float data1
float data2
}
But the text file is in the format
hh:mm:ss data1 data2
I have an array of the struct and I need each line in the text file to be read into one record of the array. I know how to...
No activity results to display
Show More
Leave a comment: