C++ for Beginners · Lesson 1 of 5
What C++ adds and what it costs
Know what you are taking on.
C++ began as C with classes and became something much larger. It gives you the same control over memory and hardware with abstractions that make large programs manageable.
Where it is used. Games and game engines, high performance financial systems, browsers, databases, embedded systems where more structure is wanted than C offers, and anything where speed genuinely matters. It is also the language of competitive programming and appears throughout computer science courses here.
What it adds over C. Classes and objects. Templates, which let one piece of code work for many types with no runtime cost. A large standard library of containers and algorithms. References, which are safer than raw pointers. Exceptions. And automatic resource management, which is the feature that most changes how the language feels.
What it costs. It is a genuinely large language, and it accumulated features over four decades without removing the old ones. There are several ways to do most things and some of them are historical. Compiler errors involving templates are famously long and difficult.
The practical approach. Learn modern C++, meaning C++11 and later, and ignore the older idioms until you meet them in existing code. Most tutorials teach a version of the language from twenty years ago, and following them produces code that works and looks obsolete to anyone who will hire you.
Set up with a modern compiler, all warnings on, and a recent standard selected explicitly.
Check which standard your compiler defaults to and set a modern one explicitly. Most default to something older than you expect.
دیکھیں کہ آپ کا کمپائلر کون سا معیار استعمال کر رہا ہے اور جدید معیار واضح طور پر مقرر کریں۔ زیادہ تر توقع سے پرانا استعمال کرتے ہیں۔
Check what you learned
Create your free BvLogic ID to take the quiz and record your score.
Create your BvLogic ID