Im trying to write a program that can check text files for certain characters,like numbers , letters ect, what am I doing wrong here.
when I try to check for a letter I get an error saying it cant allow a comparison between pointer and integer.Code:#include <iostream> #include <fstream> #include <cstdlib> using namespace std; int main() { ifstream one; one.open("test.txt"); //character char c; while (one.good()) { c=one.get();//get character //see if its equal to what we want if(c=="f") { cout<<"yes its here"; } } return 0; }
When I try to search for a number it works, as in it loads, but dosent seem to see the number in my file.



LinkBack URL
About LinkBacks


