Click here to Skip to main content
15,907,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DLL question ( clueless ) probably self-answered Pin
Maximilien21-Jun-05 4:30
Maximilien21-Jun-05 4:30 
GeneralRe: DLL question ( clueless ) probably self-answered Pin
Antony M Kancidrowski21-Jun-05 4:44
Antony M Kancidrowski21-Jun-05 4:44 
QuestionSDI w/ splitter - SetActiveView()??? Pin
lynchspawn21-Jun-05 4:04
lynchspawn21-Jun-05 4:04 
GeneralReading a node value from XML file Pin
LCI21-Jun-05 3:40
LCI21-Jun-05 3:40 
GeneralRe: Reading a node value from XML file Pin
Tom Archer21-Jun-05 4:24
Tom Archer21-Jun-05 4:24 
GeneralRe: Reading a node value from XML file Pin
Tom Archer21-Jun-05 4:27
Tom Archer21-Jun-05 4:27 
GeneralRe: Reading a node value from XML file Pin
LCI21-Jun-05 5:03
LCI21-Jun-05 5:03 
Generalusing ifstream to read a file. Pin
Hachaso21-Jun-05 2:12
Hachaso21-Jun-05 2:12 
Hi!

I'm creating a small program that reads from a text file, using ifstream.
I'm wondering how I can tell the stream to start reading the file from the beginning?

Is this possible or do I have to close the file and reopen it?

This is what I'm doing:

ifstream file(filename);

if(!file.is_open())
{
// Error message.
}

while(!file.eof())
{
file.getline(buf, 200);
// after comes more code that is not relevant here.
}

When I do this getline starts reading line by line.
So how can I tell it to start from the beginning?

Thanks!
GeneralRe: using ifstream to read a file. Pin
xiaohe52121-Jun-05 3:17
xiaohe52121-Jun-05 3:17 
GeneralRe: using ifstream to read a file. Pin
Hachaso21-Jun-05 3:32
Hachaso21-Jun-05 3:32 
GeneralRe: using ifstream to read a file. Pin
S. Senthil Kumar21-Jun-05 3:34
S. Senthil Kumar21-Jun-05 3:34 
GeneralSave & Open Pin
suroor45321-Jun-05 1:52
suroor45321-Jun-05 1:52 
GeneralRe: Save & Open Pin
ThatsAlok21-Jun-05 2:14
ThatsAlok21-Jun-05 2:14 
GeneralRe: Save & Open Pin
xiaohe52121-Jun-05 3:12
xiaohe52121-Jun-05 3:12 
GeneralRe: Save & Open Pin
suroor45322-Jun-05 3:04
suroor45322-Jun-05 3:04 
GeneralCrash when using EditSecurity function Pin
Sudhir Mangla21-Jun-05 1:33
professionalSudhir Mangla21-Jun-05 1:33 
GeneralDebugging Internet Explorer Pin
munawar196821-Jun-05 0:58
munawar196821-Jun-05 0:58 
GeneralRe: Debugging Internet Explorer Pin
BlackDice21-Jun-05 6:25
BlackDice21-Jun-05 6:25 
GeneralCaps Lock Indicator Problem ! Pin
AbinThomas21-Jun-05 0:41
AbinThomas21-Jun-05 0:41 
GeneralRe: Caps Lock Indicator Problem ! Pin
Cool Ju21-Jun-05 2:22
Cool Ju21-Jun-05 2:22 
GeneralDetecting media present in a CD drive Pin
fainley20-Jun-05 23:10
fainley20-Jun-05 23:10 
GeneralRe: Detecting media present in a CD drive Pin
Bob Stanneveld20-Jun-05 23:34
Bob Stanneveld20-Jun-05 23:34 
GeneralRe: Detecting media present in a CD drive Pin
Cedric Moonen20-Jun-05 23:42
Cedric Moonen20-Jun-05 23:42 
GeneralRe: Detecting media present in a CD drive Pin
Bob Stanneveld20-Jun-05 23:45
Bob Stanneveld20-Jun-05 23:45 
GeneralRe: Detecting media present in a CD drive Pin
ThatsAlok20-Jun-05 23:58
ThatsAlok20-Jun-05 23:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.