User Profile

Collapse

Profile Sidebar

Collapse
mike91
mike91
Last Activity: Mar 29 '10, 12:29 PM
Joined: Mar 2 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • mike91
    replied to read text file into formatted struct array
    in C
    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.
    See more | Go to post

    Leave a comment:


  • mike91
    replied to read text file into formatted struct array
    in C
    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.
    See more | Go to post

    Leave a comment:


  • mike91
    started a topic read text file into formatted struct array
    in C

    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...
    See more | Go to post
No activity results to display
Show More
Working...