Re: language books don't get outdated

From: Mike Wahler (mkwahler_at_mkwahler.net)
Date: 08/26/04


Date: Thu, 26 Aug 2004 17:18:39 GMT


"Gary Labowitz" <glabowitz@comcast.net> wrote in message
news:3Kadncl4hZaydLDcRVn-rQ@comcast.com...
> "Paul" <paul@paul.com> wrote in message
news:GcjXc.16994$oD2.105@trndny08...
> >
> > "Carter Smith" <news@email.icarusindie.com> 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.3088)
>
> // 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



Relevant Pages

  • Re: fatal error C1083
    ... go to project settings and disable precompiled headers (in eVC it's a project wide setting IIRC, in VS 2005 you can enable/disable per file). ... fatal error C1083: Cannot open precompiled header file: ...
    (microsoft.public.windowsce.embedded.vc)
  • Inherit properties from a folder.
    ... I have two separate ... precompiled headers, with some files using one, and others using ... ... it automatically inherits the project settings. ...
    (microsoft.public.vsnet.ide)
  • RE: SendInput and Importing Libraries
    ... I just deleted that line in every c file and went to project settings (alt + ... and on the c/c++ tab there was a drop down list, I chose precompiled headers ... and clicke on: "Not using precompiled headers". ...
    (microsoft.public.vc.language)
  • Re: Comparing a variant string with char*
    ... Aviraj wrote: ... I understand what you are saying, but the above code compiles and runs ... likely that the problem is because of project settings. ...
    (microsoft.public.vc.mfc)
  • Re: Pls--Need help with Hellow World! with MS Visual C++ 6.0
    ... but that compiler is preset to ... I'ld suggest disabling precompiled headers in the ... his source elsewhere (or bring some source code from ...
    (microsoft.public.vc.language)