Dont know how to do this. Tried something like below.Want more optimisation in code.
Everyting should be in one function only,
guide me how to open close a file,
how to find character in each line,
increase the counter.
void simpleFileIn(void) {
string line;
ifstream myfile("example.txt");
if (myfile.is_open()) {
while (getline(myfile, line)) {
//found(line);
size_t size = strlen(line);
cout << line << '\n';
}
myfile.close();
}
else
cout << "Unable to open file";
}
the function simpleFileIn() should work, to open a file then close after work is done.
find out character a and count the integers.
want to close/ delete this question as i am in ban asking more help me. situation getting worse day after day
*pptr=ptr;
. Especially what the difference is between its effect onpptr[0]
andpptr[1]
.std::vector
instead of raw arrays"