Click here to Skip to main content
15,891,701 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Possible to build static Libs with Ressources? Pin
Mike Dimmick12-Oct-03 2:42
Mike Dimmick12-Oct-03 2:42 
GeneralRe: Possible to build static Libs with Ressources? Pin
conman11012-Oct-03 4:52
conman11012-Oct-03 4:52 
Generalsorry for the newbie questions hehe Pin
N.Byarley11-Oct-03 16:48
N.Byarley11-Oct-03 16:48 
QuestionHow to read a file line-by-line? Pin
IGx8911-Oct-03 14:33
IGx8911-Oct-03 14:33 
AnswerRe: How to read a file line-by-line? Pin
ZoogieZork11-Oct-03 16:23
ZoogieZork11-Oct-03 16:23 
AnswerRe: How to read a file line-by-line? Pin
Mike Dimmick12-Oct-03 2:43
Mike Dimmick12-Oct-03 2:43 
GeneralRe: How to read a file line-by-line? Pin
IGx8912-Oct-03 10:09
IGx8912-Oct-03 10:09 
AnswerRe: How to read a file line-by-line? Pin
W. Hammer -sledge-12-Oct-03 6:41
W. Hammer -sledge-12-Oct-03 6:41 
You can use getline()
#include <fstream.h>    

void main()
{
  char buffer[256];
  ifstream file;
  file.open("c:\\autoexec.bat", ios::in | ios::nocreate);

  if (file.good())
  {
    while(file.peek() != EOF)
    {
      file.getline(buffer,255);
      cout << buffer << endl;
    }
    file.close();
  }
  else
    cout << "error opening autoexec.bat" << endl;
 


 }
the default delimiter for getline is \n, see msdn for more details.

Hope this helps

sledge
AnswerRe: How to read a file line-by-line? Pin
valikac12-Oct-03 16:35
valikac12-Oct-03 16:35 
GeneralOpenRequest Pin
Anonymous11-Oct-03 12:20
Anonymous11-Oct-03 12:20 
GeneralBook on VC++ and mail Applications Pin
deep72511-Oct-03 12:11
deep72511-Oct-03 12:11 
GeneralBook on VC++ and mail Applications Pin
deep72511-Oct-03 12:10
deep72511-Oct-03 12:10 
GeneralRe: Book on VC++ and mail Applications Pin
valikac12-Oct-03 16:38
valikac12-Oct-03 16:38 
QuestionCopy,Paste and Rename..Is This Possible?? Pin
Member 50926811-Oct-03 11:35
Member 50926811-Oct-03 11:35 
AnswerRe: Copy,Paste and Rename..Is This Possible?? Pin
Michael Dunn11-Oct-03 12:07
sitebuilderMichael Dunn11-Oct-03 12:07 
GeneralRe: Copy,Paste and Rename..Is This Possible?? Pin
Member 50926811-Oct-03 12:32
Member 50926811-Oct-03 12:32 
AnswerRe: Copy,Paste and Rename..Is This Possible?? Pin
User 665811-Oct-03 13:09
User 665811-Oct-03 13:09 
QuestionHow can I open PS/2 port Pin
asd175311-Oct-03 10:49
asd175311-Oct-03 10:49 
AnswerRe: How can I open PS/2 port Pin
Blake Coverett11-Oct-03 12:51
Blake Coverett11-Oct-03 12:51 
GeneralRe: How can I open PS/2 port Pin
asd175311-Oct-03 13:04
asd175311-Oct-03 13:04 
GeneralRe: How can I open PS/2 port Pin
Blake Coverett11-Oct-03 13:25
Blake Coverett11-Oct-03 13:25 
GeneralRe: How can I open PS/2 port Pin
asd175311-Oct-03 23:14
asd175311-Oct-03 23:14 
QuestionHow to read / write file Pin
Snyp11-Oct-03 10:07
Snyp11-Oct-03 10:07 
AnswerRe: How to read / write file Pin
Bo Hunter11-Oct-03 10:38
Bo Hunter11-Oct-03 10:38 
Questionhow to convert a project to non UNICODE Pin
OO-P11-Oct-03 7:41
OO-P11-Oct-03 7:41 

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.