I'm getting some junk value instead of first character. I think i have gone wrong in reading the stream position
string line;
int count=0;
streampos a[10];
fstream question("filename.txt");
while(!question.eof())
{
a[count]=question.tellg();
getline(question,line);
count++;
}
// cout<<count;
int temp=0;char ch;
while(temp<count)
{
question.seekg(a[temp++],ios::beg);
question>>ch;
cout<<ch<<endl;
}