I have to write a program that reads a text file that contains +/- values and characters and outputs any invalid characters (anything that is not an +/- integer) and also at the end i have to have it print out the total number of how many invalid characters there are. this is my code so far and the problem im having is that it outputs everything
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
int main()
{
ifstream data("data.txt");
char ch;
while(data.get(ch))
{
cout<<ch;
}
data.close();
cout<<endl;
system("PAUSE");
return 0;
}