Question about compilers....

D

dydx31

Hello my fellow programmers,

I have a question for you all: What is the best C++ compiler to use
when programming? I have used borland turbo C++ for awhile now,
however, I went out and bought a book by H. Dietel: C++: how to
Program. Its a lot different than my other C++ book. for instance
when using the cout code,,it uses it like this(in the dietel book)

std::cout<<"text...\n";

In my other academic textbook it uses cout like this:

cout<<"Text....\n";

When I put the std::cout<<"text..\n";
in my borland compiler,,i got an error message..something about a
class and that i was missing a ";" .

I've heard a lot of good things about microsoft visual C++. Is it a
good compiler to use to make simple programs? I'm not developing
major software apps(not yet). My programs are only 100lines
long,,if that.
Please point me in the right direction..I would really appreciate
it!

Thanks again,

Nathan ;)
 
R

Raymond Martineau

Hello my fellow programmers,

I have a question for you all: What is the best C++ compiler to use
when programming? I have used borland turbo C++ for awhile now,
however, I went out and bought a book by H. Dietel: C++: how to
Program. Its a lot different than my other C++ book. for instance
when using the cout code,,it uses it like this(in the dietel book)

std::cout<<"text...\n";

This follows one of the later versions of C++.

Also, that's not the best way to do output. You should consider this
instead:
std::cout << "text..." << std::endl;
In my other academic textbook it uses cout like this:

cout<<"Text....\n";

Unless "using std::cout;" or "using namespace std" was declared, the
textbook that uses this construct is obsolete. This change is meant to
clean up the global namespace, which can cause problems if it is
unchecked.
When I put the std::cout<<"text..\n";
in my borland compiler,,i got an error message..something about a
class and that i was missing a ";" .

You'll need to upgrade your compiler to a later version. If such a
version doesn't exist, you may have to look for a different compiler.
As long as your new choice abides by the latest standard, you shouldn't
have any trouble.
 
I

Ian Collins

Hello my fellow programmers,

I have a question for you all: What is the best C++ compiler to use
when programming?

That's a bit like asking "what's the best car to use?"

There are may platforms and may choices of compilers for each.

Try a group dedicated to programming on you operating system.

I have used borland turbo C++ for awhile now,
however, I went out and bought a book by H. Dietel: C++: how to
Program. Its a lot different than my other C++ book. for instance
when using the cout code,,it uses it like this(in the dietel book)

std::cout<<"text...\n";

In my other academic textbook it uses cout like this:

cout<<"Text....\n";
When I put the std::cout<<"text..\n";
in my borland compiler,,i got an error message..something about a
class and that i was missing a ";" .
So it probably lacks standard headers (<iostream> in this case). If so,
throw it away, it is out of date.
 
S

Steve Pope

Raymond Martineau said:
On Nov 3, 10:01 pm, Nathan ([email protected]) wrote:

This follows one of the later versions of C++.

Also, that's not the best way to do output. You should consider this
instead:
std::cout << "text..." << std::endl;

Wasn't there a discussion about this just a few weeks ago,
concluding that "endl" is evil?

Steve
 
B

BobR

Steve Pope wrote in message ...
Wasn't there a discussion about this just a few weeks ago,
concluding that "endl" is evil?

Steve

'endl' is not "evil". It sends a '\n' and flushes the buffer (sometimes
needlessly).

std::cout << "text..." << std::endl;
std::cout << "some more text..." << std::endl;

could better be written:

std::cout << "text...\n";
std::cout << "some more text..." << std::endl;

or:

std::cout << "text...\n"
<< "some more text..." << std::endl;

I think the point was: 'over use' is evil (like I do. <G>).


To OP [my opinion, not the groups]:
If you are using windows, I highly suggest Dev-C++ IDE (with the MinGW port
of GCC). It is an easy install. You can later point the IDE to use other
compilers, or point other IDEs to use the MinGW GCC compiler(s). ($=a
download).
Dev-C++ IDE: http://www.bloodshed.net/
 
D

dydx31

Thanks a lot for the suggestions guys. I am now using Microsoft
Visual Studio 2005 Professional. Is that good enough? Or is that
"current" with the new standard.

Thanks again!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top