i am a newbie in C++ file processing...
Any1 can guide me to search for an item(lastname) in the example below?
what is seekg or seekp... how to use it?
#include<iostream>
#include<fstream>
using namespace std;
void main(){
char firstname[10], lastname[10];
int age;
ofstream write("text.txt", ios::app);/*actually i am not sure what ios::app does*/
cout<<"firstname: ";
cin.getline(firstname,sizeof(firstname));
cout<<"last name: ";
cin.getline(lastname,sizeof(lastname));
cout<<"age: ";
cin>>age;
cin.ignore();
write<<firstname<<endl;
write<<lastname<<endl;
write<<age<<endl;
}