This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++ question


Is there a good book that not only brushes up C/C++ skills but also focuses
on Makefiles, etc. (GNU-make, GNU-gcc, autoconf, etc.)

Thanks

-Matt
----- Original Message -----
From: "LLeweLLyn Reese" <llewelly@lifesupport.shutdown.com>
To: "Alexander Helm" <520075708323-0001@t-online.de>
Cc: "John Burski" <jburski@cloudnet.com>; "SCALUG"
<scalug-list@mn-linux.org>; <gcc-help@gcc.gnu.org>
Sent: Wednesday, December 25, 2002 4:28 PM
Subject: Re: c++ question


> 520075708323-0001@t-online.de (Alexander Helm) writes:
>
> > Hi John,
> >
> > John Burski wrote:
> > > [...]
> > > // File: hello.cpp
> > > #include <iostream>
> >
> > using namespace std;
>
> Do you really want to bring in everything in namespace std? Like
>     'count' and 'y1'? I don't think so.
>
> using std::cout;
>
> will bring in only cout. It's better to use individual using statements.
>
> >
> > > int main() {
> > >    cout << "Hello, World\n";
> > > }
> > > [...]
> >
> > If you add the above line everything should do fine (alternativly you
> > can use std::cout instead of cout)
> >
> > > [...]
> > > INCLUDE = /usr/include/g++-3
> > > LIBES = -lstdc++-3-libc6.2-2-2.10.0
> > > hello: hello.o
> > > g++ -o hello hello.o $(LIBES)
> > > hello.o: hello.cpp
> > > g++ -c -I$(INCLUDE) hello.cpp
> >
> > I would urge you not to include system-libraries this way, it makes
> > your source less portable.
> >
> > CU
> > Alexander
>



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]