Search Result

Collapse
2 results in 0.0037 seconds.
Keywords
Members
Tags
filing
  •  

  • How to append data to file and clear it when it's closed

    I have values changing at some rate per second that i am storing in a variable then i am printing these values in a file. So i have to append the values into the file so that they are not over written and all the values are displayed line by line. But when i close the program i need the file to be cleared. But only when i close the program and not when the function exits that it clears the file.
    See more | Go to post

  • kino
    started a topic How to read from a text file?
    in C

    How to read from a text file?

    Hello,

    I am supposed to read from a text file a series of numbers and then store them in a struct array.

    Here's my code:

    Code:
    int main()
    {
        ifstream In;
        string folder, filename, name2, line;
        int i = 0;
        
        cout << endl << "Enter the name of the folder" << endl;
         cout << "Follow the format: c:/your_folder_name/
    ...
    See more | Go to post
Working...