How to write a program that will read a list of strings from a file into an array...

Discussion in 'C Programming' started by jennifermackles, Nov 13, 2012.

  1. jennifermackles

    jennifermackles

    Joined:
    Nov 13, 2012
    Messages:
    1
    How to write a program that will read a list of strings from a file into an array, which size is 30. The program needs to say whether the elements are full, and if there are fewer or more items. The two programs are named Example.txt, and Example2.txt, where Example1.txt has more items and the other has less. It also needs to ask the user to re-enter the file name if the input is invalid. Minimum requirement is to use these two functions: • getInput – gets the file input and puts it into the array. Also determines if there are enough values or too many. Called from main. The function returns a bool value to indicate whether or not reading the file was successful. • openFile – opens the input file for getInput. Called from getInput.
    jennifermackles, Nov 13, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Klaus Neuner
    Replies:
    7
    Views:
    486
    Klaus Neuner
    Jul 26, 2004
  2. Ben

    Strings, Strings and Damned Strings

    Ben, Jun 22, 2006, in forum: C Programming
    Replies:
    14
    Views:
    755
    Malcolm
    Jun 24, 2006
  3. noydb
    Replies:
    12
    Views:
    337
    noydb
    Aug 19, 2011
  4. Mahurshi Akilla
    Replies:
    5
    Views:
    111
    Bart Lateur
    May 14, 2009
  5. sahm
    Replies:
    4
    Views:
    679
    stledger@lanl.gov
    Oct 15, 2012
Loading...

Share This Page