File handling, character check
Im trying to write a program that can check text files for certain characters,like numbers , letters ect, what am I doing wrong here.
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 check for a letter I get an error saying it cant allow a comparison between pointer and integer.
When I try to search for a number it works, as in it loads, but dosent seem to see the number in my file.