Reading Files

This is a discussion on Reading Files within the C Programming forums, part of the General Programming Boards category; I have a file that stores high scores for games as an int , but I want to be able ...

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

    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
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,789
    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, 10: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, 09:43 AM
  5. Need Advice in reading files
    By jon in forum C Programming
    Replies: 4
    Last Post: 10-07-2001, 07:27 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21