i'm not going to post the entire code but i'll post the relevant part. the situation is i have a .txt file (input.txt), and the program reads that and counts the characters in it and displays the number of characters, spaces, digits, etc. but i also want it to display the actual text from the file. is there a way to have it display the file, without actually copying and pasting all of the text into the compiler?
so instead of cout<<"1000000 words"
something like that.
so this is the first part of the code that opens the file. how do i make the program display the text when i run it?
using namespace std;
bool myIsAlpha( char ch );
bool myIsDigit( char ch );
bool myIsUpper( char ch );
int countPunct = 0, //declaring int variables to be used.
countAlpha = 0,
countUp = 0,
countLow = 0,
countDig = 0,
countSpace = 0,
char ch; //declaring ch as char
//opening the input file and if it fails to open, displaying and error message to the user and exiting the program
inputFile.open( "input.txt" );
if( inputFile.fail() )
cout << "input.txt failed to open";
exit( -1 );