I am using a function that uses a char* parameter; i am reading from a file for input. Here is my code:
std::ifstream infile("file.txt");
std::string line;
while(std::getline(infile,line)){
if(pass(line.c_str())==0) cout<<"this is correct"<<line<<endl;
}
the pass function is
int pass(char* a);
//compares c_string to hidden c_string
//if the same then return 0, else retuns -1
I am compiling using g++ -c 6.cpp and the error is:
invalid conversion from 'const char*' to 'char*'
initializing argument 1 of 'int pass(char*)