Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Beginers Question about Getline

Thread Tools

Beginers Question about Getline

Posts: n/a
      08-25-2004 Removed) (Jon Bell) wrote in message news:<cggcr7$130$(E-Mail Removed)>...
> In article <(E-Mail Removed) >,
> Skywise <(E-Mail Removed)> wrote:
> >
> >#include <time.h>
> >#include <fstream.h>
> >#include <string>

> <fstream.h> is not the standard header for file streams. You should use
> <fstream> instead. In general, you should never mix the "old" (really,
> ancient!) .h headers with the "new" (now six years old) standard non-.h
> headers. They can be incompatible in sneaky ways. I'm not guaranteeing
> that this is the cause of your problem, but you should fix it anyway.
> Change <time.h> to <ctime> while you're at it.

That did it. I changed all my includes to the younger include files,
and got it to work with no errors. I want to express my personal
thanks to everyone who took the time to read my code and help me work
through the code and headers. I was begining to get frustrated.
Thank you again. You made my day.

Reply With Quote
Posts: n/a
Skywise wrote:

> At the begining of my program, I have:
> #include <time.h>
> #include <fstream.h>
> #include <string>

I don't think fstream.h or fstream provide everthing that
iostream provides. Try including iostream as well and see if
that doesn't solve your problem.


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best exercises for beginers to learn? Python 1 11-09-2010 08:27 AM
Html for Beginers Additya HTML 9 12-10-2009 05:28 PM
strings for beginers Sapote Python 2 03-07-2009 09:29 PM
Studio Flash for Beginers Bruce Digital Photography 3 11-23-2008 11:47 PM
which text book is just for the c++ beginers? C++ 6 03-09-2007 05:34 PM