Thread: Reading Files

  1. #1
    UnknownAmateur Programmer
    Join Date
    Sep 2008
    Were definitly not in Kasas anymore...

    Reading Files

    I have a file that stores high scores for games as an int, but I want to be able to read a string from the same file so I can include the name of the person who set that score. I can read multiple int's but not an int and string. How do I do this? Thanks for your help.
    Last edited by C-Compiler; 09-27-2008 at 01:33 PM. Reason: Not enough information

  2. #2
    Join Date
    Oct 2007
    Inside my computer
    You can open the file with r+ for read and write.
    Then you can both read and write to the file.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading User Defined Files
    By Necrofear in forum C++ Programming
    Replies: 17
    Last Post: 06-30-2006, 12:55 AM
  2. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:46 AM
  3. reading files
    By hiya in forum C++ Programming
    Replies: 7
    Last Post: 05-21-2005, 11:40 AM
  4. A little help reading from files...
    By Invincible in forum C++ Programming
    Replies: 4
    Last Post: 04-03-2002, 10:43 AM
  5. Need Advice in reading files
    By jon in forum C Programming
    Replies: 4
    Last Post: 10-07-2001, 07:27 AM