Thread: need info on saving/loading data

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    11

    need info on saving/loading data

    I can't find tutorials or forum posts on this anywhere, for some reason.

    I want to take INT and/or STRING values and write them to a file (.txt or otherwise) that can be re-read by the program on the next run. Can I pipe the output of printf or something?

    Thanks in advance.

  2. #2
    Registered User Kernel Sanders's Avatar
    Join Date
    Aug 2008
    Posts
    61
    Look at fopen to open a file, fprintf to write to a text file, and fwrite to write to a binary file

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    11
    Thanks man, looks like what i need.

  4. #4
    Registered User valaris's Avatar
    Join Date
    Jun 2008
    Location
    RING 0
    Posts
    507
    I wouldn't write out in a binary format unless you are sure the data won't need to be portable.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. xor linked list
    By adramalech in forum C Programming
    Replies: 23
    Last Post: 10-14-2008, 10:13 AM
  2. Replies: 3
    Last Post: 04-18-2008, 10:06 AM
  3. Replies: 8
    Last Post: 03-10-2008, 11:57 AM
  4. Reading a file with Courier New characters
    By Noam in forum C Programming
    Replies: 3
    Last Post: 07-07-2006, 09:29 AM
  5. C diamonds and perls :°)
    By Carlos in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 05-16-2003, 10:19 PM