The online course I'm taking has examples that aren't quite compatible with G++/Cygwin

For instance,

#include <iostreams.h>

void main()
{
cout << "Hello\n";
}

when compiled with g++, throws a couple of warnings about deprecated headers in iostreams.h and an error for using void rather than int for the type of main.

Empirically I discovered that int helped (even if no value was returned) and that the include <iostreams> worked. It was also necessary to add "using namespace std;" as the first statement for cout to be recognized.

Can someone suggest a good language reference manual and programmer reference manual for g++?

#include <iostreams.h>
That's never been C++. In the old days there was a
#include <iostream.h> , which I suspect is what you meant, but that's not been C++ since 1998, when the following was formalised:
#include <iostream>


void main()
That was never C++. main returns an int.

Whatever this online course is, it appears to be teaching a mixture of just plain not C++, and C++ that's been wrong for almost 15 years.

In terms of references, this http://www.cplusplus.com/reference/ is quite readable, this http://en.cppreference.com/w/ is better but not quite so easily read, and for g++, the online documentation is http://gcc.gnu.org/onlinedocs/

I think you'd do better at this point though to keep reference manuals on the back burner until you've gone through some basics.
Last edited on
Sorry about the typo in the post with iostreams. There was no "s" in the code itself.

I've been going through the tutorial here but it sometimes gets a little abstract. C++ has many features but the motivation for them can be obscure. I've looked at a couple of the references you mention but they seem to cover more of the libraries than aspects of, e.g., characteristics of classes.

I've found and purchased the C++ Primer Plus (6th Edition), which appears to go over the material with the precision and depth I'm seeking at this time.
Last edited on
Topic archived. No new replies allowed.