Thread: Read of fstream

  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    4

    Read of fstream

    I'm ask using a notepad ,prepare a text file with mark on separate line then the program will then read this file and store all the marks into an array it will then calculate the average mark and finally display all the marks and average mark on the screen.

    i need a head start on how to read a simple text file and out into the screen then at least i know how to continue with this one.

    Like for example i create a text file inside written hello and when i open the program it immediately read and display on my output screen im using code block by the way

  2. #2
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472

    faq

    there is everything you need to know in the FAQ section of this forum, its simple(r) to work with files in cpp, codeblocks will be fine, check the -how do i...- section in forum FAQs
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 03-10-2008, 11:57 AM
  2. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  3. I am lost on how to read from file and output to file?
    By vicvic2477 in forum C++ Programming
    Replies: 4
    Last Post: 02-27-2005, 11:52 AM
  4. fstream read() question.
    By Vicious in forum C++ Programming
    Replies: 5
    Last Post: 07-17-2004, 11:11 PM
  5. Help! Can't read decimal number
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 09-07-2001, 02:09 AM