Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > If you're new and need a book

Reply
Thread Tools

If you're new and need a book

 
 
Gary Labowitz
Guest
Posts: n/a
 
      08-26-2004
"Paul" <(E-Mail Removed)> wrote in message news:GcjXc.16994$oD2.105@trndny08...
>
> "Carter Smith" <(E-Mail Removed)> wrote in message
> news:XU2Xc.23719$L94.11173@fed1read07...

<<snip>>
> Second, the new Visual C++ 7.x compiler will *not* compile the code. The
> reason is that there is no such file any more as <iostream.h>. Try it an
> see for yourself. As a matter of fact, the top rated web-site that

answers
> C++ questions (which I have been an active member of now for 5 years, and
> one of its biggest contributors as far as answering C++ questions), gets
> queries from beginners as to why thei riostream.hladencodedoesn't
> compile with the latest Visual C++ compiler.


Okay, got rid of precompiled headers (I'm lazy, but not that lazy) and now
<iostream.h> generates an error.
Shows what you get for using MS defaults.
--
Gary


 
Reply With Quote
 
 
 
 
Mike Wahler
Guest
Posts: n/a
 
      08-26-2004

"Gary Labowitz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Paul" <(E-Mail Removed)> wrote in message

news:GcjXc.16994$oD2.105@trndny08...
> >
> > "Carter Smith" <(E-Mail Removed)> wrote in message
> > news:XU2Xc.23719$L94.11173@fed1read07...
> > > I was going to say, if Paul actually knew C++ he would have known that

> the
> > > code would compile just by looking at it. It would have taken all of

> two
> > > minutes to test his theory before making his false claim on a

permanent
> > > venue.
> > >

> <snip>
> > Second, the new Visual C++ 7.x compiler will *not* compile the code.

The
> > reason is that there is no such file any more as <iostream.h>. Try it

an
> > see for yourself. As a matter of fact, the top rated web-site that

> answers
> > C++ questions (which I have been an active member of now for 5 years,

and
> > one of its biggest contributors as far as answering C++ questions), gets
> > queries from beginners as to why thei riostream.hladencodedoesn't
> > compile with the latest Visual C++ compiler.

>
> I thought the bone of contention was the use of <iostream.h> so I (sorta)
> automatically inserted std:: in front of the cout and tried the following
> code in .NET (7.1.308
>
> // t1.cpp : Defines the entry point for the console application.
> //
> #include <iostream.h>
> #include "stdafx.h"
> int _tmain(int argc, _TCHAR* argv[])
> {
> std::cout << "Hello, World!\n";
> return 0;
> }
>
> I hate all the MS stdafx stuff, but that was generated by the project
> builder. The above code compiles and runs just fine. So?


So, an implementation's behavior does not define correctness,
the language standard does.
The above ((even without the 'stdafx', with _tmain() changed to 'main(),
and _TCHAR changed to 'char'), is *not* standard compliant code.

> Changing it to
>
> #include <iostream.h>
> #include "stdafx.h"
> int main( )
> {
> std::cout << "Hello, World!\n";
> return 0;
> }
>
> Still compiled and worked fine.


Same remarks as above.

>[Now, how do I get rid of MS wanting
> precompiled headers? OT OT OT OT!!!]


<OT>
It's in the menus. I don't know where in 7.1, but in 6.0
it's in the 'Project Settings' dialog, "C/C++" tab, category
"Precompiled headers". There are choices to not use, use
'automatic', or use 'manually'.
</OT>

-Mike


 
Reply With Quote
 
 
 
 
Mike Wahler
Guest
Posts: n/a
 
      08-26-2004

"Paul" <(E-Mail Removed)> wrote in message
news:fxjXc.59716$3O2.48196@trndny07...
> "Gary Labowitz" <(E-Mail Removed)> wrote in message >
> > While I disagree totally with Paul (I figured him for a flamer)

>
> And what exactly do you disagree with? What version of NET? This will not
> compile for VC++ 7.1, as noted by several that have that the compiler and
> realize that <iostream.h> is no longer included.
>
> The Comeau C++ compiler does the following with the program:
> -----------------------------------------------------
> Comeau C/C++ 4.3.3 (Aug 6 2003 15:13:37) for ONLINE_EVALUATION_BETA1
> Copyright 1988-2003 Comeau Computing. All rights reserved.
> MODE:strict errors C++
>
> "iostream.h", line 1: catastrophic error: #error directive:
> <iostream.h> is not a Standard header, use <iostream> instead.
> Note that when you change this header name, that identifiers

such
> as
> "cout" and "endl" will no longer work, as they are in namespace
> "std", so use be "std::cout" and "std::endl" respectively.
> ------------------------------------------
> So again, what is a beginner who may be using a conforming ANSI C++

compiler
> supposed to do when they get this or similar error message thrown at them
> when they compile
> their very first program?


From the error message above:

"<iostream.h> is not a Standard header, use <iostream> instead."

That seems pretty straightforward to me, shouldn't confuse even
a novice (unless he's been learning from an incorrect or outdated
book, in which case he *needs* to be informed, the sooner the better).


> Reading the "Teach yourself C++" book will not
> shed any light
> on how to fix this problem.


IMO whatever the name of a C++ book, if it teaches using e.g.
<iostream.h>, *IT IS WRONG* and should not be used.

-Mike


 
Reply With Quote
 
Gary Labowitz
Guest
Posts: n/a
 
      08-26-2004
"Mike Wahler" <(E-Mail Removed)> wrote in message
news:j_oXc.1011$(E-Mail Removed) k.net...
>

<<snip>>
> "<iostream.h> is not a Standard header, use <iostream> instead."
>
> That seems pretty straightforward to me, shouldn't confuse even
> a novice (unless he's been learning from an incorrect or outdated
> book, in which case he *needs* to be informed, the sooner the better).
>
>
> > Reading the "Teach yourself C++" book will not
> > shed any light
> > on how to fix this problem.

>
> IMO whatever the name of a C++ book, if it teaches using e.g.
> <iostream.h>, *IT IS WRONG* and should not be used.


Well, it is not standard. And wth a standard compliant compiler it won't
compile. And that's not useful.
So "wrong" isn't the right word!
What's really on topic here is that a book that teaches non-standard useage
is not useful to today's learner unless they stay with non-compliant
compilers, use extensions like that abysmal MS precompiled header, etc. The
book is outdated. It is difficult to drag people into the 21st century when
quite often the new versions don't work as well, smoothly, or the same way
as the old ones. I shudder to think of all the things I will have to wade
through to move "up" to .NET. (What in hell was wrong with VB 6.0?)
--
Gary


 
Reply With Quote
 
Victor Bazarov
Guest
Posts: n/a
 
      08-26-2004
Gary Labowitz wrote:
> [...] I shudder to think of all the things I will have to wade
> through to move "up" to .NET. (What in hell was wrong with VB 6.0?)


"Everything" doesn't even begin to describe it. The sooner you move
to 7.1, the healthier you're going to be, and the more hair your head
is going to retain.

V
 
Reply With Quote
 
 
 
Reply

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
Does anyone got the e-book for the book MCTS Training Kit (70-528) =?Utf-8?B?WWlu?= MCSD 0 11-18-2006 03:30 AM
need a new Ruby book? stuinzuri Ruby 7 11-13-2006 03:23 PM
"Java Performance Tuning Book" anyone read this book? coltrane Java 2 09-27-2006 01:13 PM
Need to get Address book into new mailreader Sigi Rindler Computer Support 2 07-18-2005 11:12 AM
awt book+java animation book Thanasis \(sch\) Java 1 10-14-2004 03:02 PM



Advertisments