C++ is an enhanced version of C language. It is a general purpose programming language that includes everything that is part of C and also has imperative, object-oriented and generic programming features. C++ is viewed by many as the best language for creating large-scale applications.
C++ appeared in 1983. Designed by Biarne Stroustrup. C++ stably released in 2011. The design of C++ was influenced by C language and some other languages. After C++ appeared, it has influenced a lot to make famous languages like Perl, LPC, Java, PHP etc.
There are many wonderful features in C++. The main feature of C++ is that it supports Object-Oriented Programming (OOP) concepts. There are main three concepts of OOP:
We will discuss these features later. Because OOP is the main concept of C++, understanding object-oriented thought is the first rule for learning C++. This is important because not only C++, but every new style or famous language follows the object-oriented concept. We will have a full lesson on Object-Oriented Programming.
Let’s look at the other features of C++:
- C++ is an open ISO (International Organization for Standardization) language
- It is a compiled language
- It is a strongly typed language
- It supports both manifest and inferred typing
- It supports both static and dynamic type checking
- It is portable
- It is upwards compatible with C
- It has incredible library support
C++ Standard Library is a collection of classes and functions. The function of C++ Standard Library includes several generic containers, function objects, generic streams, supports for some language features, and much more. Features of the C++ Standard Library are declared within std namespace.
A namespace is simply a declarative region. The purpose of a namespace is to localize the names of identifiers to avoid name collisions. So, how it will be written on the code?
using namespace std;
After writing this statement, you don’t need to worry if you’re working with an old-style header or you’re working with a new-style one. The compiler will automatically detect necessary things.
A header file is generally used to define interfaces within an application. A header file controls your whole code. You can modify your source code whenever you want, but the header file wouldn’t change. The features of header file are given below:
- Class description and inheritance hierarchy
- Class data members and types
- Class methods
Please, don’t mix the Header file and Library. As a beginner it maybe confusing. Simply put, the header file is just the way you can control your code, whereas the library is a collection of code that you want to make available to the program. It’s the fundamental difference between “interface” and “implementation”; the interface (header) tells you how to call some functionality (without knowing how it works), while the implementation (library) is the actual functionality.
A complete list of header files can be found here
Uses of C++
There’s no need- or time!- to learn all possible uses of C++. C++ is used widely all over the world. Some of common uses are given below:
Adobe Systems: All major applications of Adobe Systems are developed in C++:
- Photoshop & ImageReady
- Frame (mostly C, some C++)
Apple: OS X is written in a mix of language, but a few important parts are C++. The two most interesting are:
- The iPod user interface (uses Pixo application framework written in C++)
- Frameworks: There are three major C++ application frame works developed for Macintosh:
- Apple’s MacApp (some MacApp applications)
- Symantec’s Think Class Libraries
- Metrowerks’ PowerPlant
There are also a number of smaller (in market share) frameworks that have been developed
Facebook: Several high-performance and high-reliability components
GCC: GCC now uses C++ as its implementation language .The GNU Compiler Collection includes front ends for C, C++.
Google: World’s most famous search engine Google uses C++ for their :
- Chromium browser.
- Google file system.
- MapReduce large cluster data processing
HP: Here is a tiny fraction of HP’s C++ apps:
- C, C++, Fortran90 compilers, and linker for the new HP IA64 platform (more than 1 million lines of C++ code)
- SAM (HP’s system management utility)
- Some of the networking libraries in HP-UX
- Java VM core
- Parts of Openview
Mozilla: Firefox browser and Thunderbird mail client (open source)
MySQL: MySQL Server (about 250,000 lines of C++) and MySQL Cluster. Arguably the world’s most popular open source database
Some of the most popular compilers of C++ include:
- C++ Builder
- Turbo C++ Explorer
- C++ Compiler
- Borland C++
- Visual C++
A complete list of compilers can be found here