C Question reading from and to files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • albs
    New Member
    • Mar 2008
    • 3

    C Question reading from and to files

    Hello,

    I am studying surveying and writing a program to help my needs. So far this program reads my input file and performs what i want by outputting it to another file. I then after displaying that information want to Re-read the same file into my while loop and perform some adjustment computations to it through Least Sqaures. The problem is when i try to reopen that file it will not work.

    I have tryed fclose(in);
    then reopening. didnt work.
    and also i tryed rewind(in);
    and it compiles but doesnt work.

    How do i reopen this file and get data from it again without shooting this information to a whole new file?

    thank you in advance.
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    How big is the file? Can you hold it all in memory and manipulate it as you need to?

    Comment

    • albs
      New Member
      • Mar 2008
      • 3

      #3
      the file contains about 500 traverse points. each including and elevation northing easting backsight and forsight. so the file isnt way to big.

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Can you show a bit of relevant code? Closing the file and reopening it again
        should work.

        kind regards,

        Jos

        Comment

        Working...