textfiles

This is a discussion on textfiles within the C++ Programming forums, part of the General Programming Boards category; I need to know how to write a program which opens a textfile and counts how many spaces and vowels ...

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    7

    Question textfiles

    I need to know how to write a program which opens a textfile and counts how many spaces and vowels it contains. The name of the file should be read in from the user. If the file could not be opened (because it does not exist, for example) the program reports an error message and stops.
    Note that the vowels are counted, whether they are upper or lower case. One way to overcome this is to uppercase the character read in from the file, using the toupper( ) function. Then compare the character to the set of uppercased vowels.


    Can you help me?
    Thanks
    David

  2. #2
    Registered User
    Join Date
    Aug 2002
    Location
    Hermosa Beach, CA
    Posts
    446
    >Can you help me?

    Sure, sounds like an interesting homework assignment. Let's see what you have written, and we'll go from there.
    The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Scan Textfiles
    By Coding in forum C++ Programming
    Replies: 19
    Last Post: 02-07-2008, 06:27 AM
  2. reading textfiles using variable names
    By rjcarmo in forum C++ Programming
    Replies: 3
    Last Post: 05-13-2003, 03:05 PM

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