O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Recap

You might now see the similarities between the C support and C++ implementations of input and output (console and file) and strings. It pays to remember that the C libraries are still supported under C++ (so you can still use sprintf rather than iostream), but the C++ versions are considered superior, and in many cases, are more elegant.

What you cannot do with C easily is support overloading, so it becomes much more convoluted to create your own specializations of the base library classes. It is often said that anything C++ can do, C can be made to do, too, and this is borne out by the fact that C++ can be “converted to” C and then compiled by a C compiler.

So you might be tempted to treat C++ as merely C with classes, but that would mean ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required