Thread: Please help!!

  1. #1
    Registered User
    Join Date
    Oct 2001

    Please help!!

    Ok....thanks for the help on my post yesterday and if you could help me once more it would be greatly appritiated. How do you refer to a previous character in c++? my program is going through a text file and echo printing each character and adding one to the counter each time it hits a space..this is how i am counting the words...however if you putt two spaces between two words then it add's two too the counter which poses an obvious I need it to count spaces only if the previos charcter was not a space but i havetn a clue how you refer to previous characters in a while loop...I could really use your help on this one.

  2. #2
    Registered User kitten's Avatar
    Join Date
    Aug 2001
    The offset in the file can be changed. This is done automatically when you read bytes, and you can also alter it yourself. If you're using fopen() you should check your helps for fseek() and ftell(). If you're using fstream, look for fstream::seekp(), seekg(), tellg() and rdbuf().
    Making error is human, but for messing things thoroughly it takes a computer

Popular pages Recent additions subscribe to a feed