Thread: Help Please Reading text C programming

  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    1

    Help Please Reading text C programming

    hi there
    I'm a begginner in C programming Im writing code that reads a text file( i Have attached the source)
    here is the text from the file input.txt (below ) basically i want to print the number sets 5 2 0, 9 13 5... etc however i have made it so that the code prompts for which data set i want to know how do i go around doing so, eg if the user types 1 it prints 5 2 0, if the user typed 3 it prints out 0 1, so for i have it printing "Here is the data

    First data set:
    # "
    So i've written it to print up to the first hash character.

    Here is the data

    First data set:
    #
    3
    5 2 0

    Second data set:
    #
    7
    9 13 5 700 5 2 1

    Third data set:
    #
    2
    0 1


    cheers any help would be great

  2. #2
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,534
    You need to attempt some code before you ask for help. Nobody wants to write your program for you. Since you didn't read the forum rules first, you likely also didn't read the thread on posting code. So read the following threads (linked below), then get to work on your program. Afterward, if you get stumped, you can ask for help.

    Forum Guidelines - Read before posting
    Homework
    Posting Code? Read this first!
    Last edited by kermit; 09-28-2009 at 07:33 PM.

  3. #3
    Registered User
    Join Date
    Sep 2009
    Location
    USA
    Posts
    63
    you said you made it read and out put rite...do post your code no matter how crude it is..we will help u guide "if we can"...will try our best ..but do post your code plz

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. reading text
    By Anator in forum C++ Programming
    Replies: 33
    Last Post: 01-30-2008, 12:13 PM
  2. reading a char at a time from text
    By dudeomanodude in forum C++ Programming
    Replies: 7
    Last Post: 01-29-2008, 12:27 PM
  3. reading from a text file help......
    By jodders in forum C++ Programming
    Replies: 2
    Last Post: 01-25-2005, 12:51 PM
  4. Reading text file and structuring it..
    By Killroy in forum C Programming
    Replies: 20
    Last Post: 11-19-2004, 08:36 AM
  5. Reading Tab Separted Text files
    By Cathy in forum C Programming
    Replies: 1
    Last Post: 02-15-2002, 10:28 AM