Next
C++ Introduction:
What is C++?
C++ is a programming language which is a superset of the C language. The C language is known as C language because it is a successor of B language and was developed by Dennis Ritchie. C++ is a middle level programming language and it is developed by Bjarne Stroustrup in 1979 at Bell Labs as the extension to C language and was originally named as C with Classes but later it was renamed as C++ in 1983. The C++ language can run on various platforms like Windows, Mac OS, and even on various versions of UNIX. The C++ is an object oriented language. This C++ tutorial will help new learners to understand all C++ concepts in easy way with examples.
Start C++ programming tutorial
C++ Tutorial ( C++ Programming ) topics:
C++ Introduction
C++ is a programming language which includes the main four pillars of object oriented development. Those concepts are: Data Hiding, Inheritance, Encapsulation, Polymorphism. What are the features of C++? C++ is an object oriented programming language…more…
C++ Basic program
Introduction: Now, before learning the C++ language, you need to learn that how to write and compile the programs in C++ language. To understand the program briefly let us has a look at the example…more…
C++ Data types & Modifiers
Data types are used to define the variables that the same of type data it can store in memory. The data types determine the type of data to be stored in memory. The data types are used to represent the different values to be stored in the variable…more…
C++ Identifiers, Keywords
To identify a class, variable, function or any of the other user defined item you use identifiers so, this concept is known as Identifiers. The identifier starts with a letter ‘A’ to ‘Z’ or ‘a’ to ‘z’ or from underscore (_) followed by zero or more letters, underscores and digits (0 to 9)…more…
C++ Constants
The constants can be referred as fixed values that the program cannot change, it cannot be altered. The constants are also known as Literals. They are initialized at the time of creation and new values cannot be assigned later on…more…
C++ Variables
Variables are used to store the values which can be modified later on in the program. The variables can be declared in many ways and every way with different memory requirements. It is a name of memory location that is allocated by the compiler depending upon the data type of the variable…more…
C++ Operators & Expressions
The operators are the special type of functions that takes one or more parameters and gives new result. It is a symbol that tells the compiler to perform the mathematical and logical manipulations. The programming language like C or C++ is incomplete without the use of operators…more…
C++ Decision control statements
The decision control statements are the decision making statements that decides the order of execution of statements based on the conditions. In the decision making statements the programmer specify which conditions are to be executed or tested with the statements to be executed if the condition is true or false…more…
C++ Loop control statements
The loops are needed to execute a block of code many of the times. In this, basically the statements are executed sequentially which means the first statement in a function is executed first than the second statement and so on. The loops are used to execute a single statement or the group of statements multiple times…more…
C++ Type qualifiers
The type qualifiers are like a token which is added to a variable and it adds an extra quality like specifying constant-ness to a variable. It provides one or two properties to an identifier. The type qualifier can appear with any type specifier but they cannot appear after first comma in a multiple item declaration…more…
C++ STORAGE CLASS SPECIFIERS
The storage specifiers define the scope or visibility and the lifetime of the variable or function within a program.The lifetime is a duration till which the variable will remain active and visibility is in which the module of the program the variable is accessible…more…
C++ Arrays
An array is a collection of similar elements of same data type at a contiguous memory location. The array is a data structure which stores the fixed size of elements in sequence.The size and the data type of an array cannot be changed after the declaration…more…
C++ Strings
The string is an object of the string class and it is defined in the header file i.e. <string.h>.The string class has many constructors that are called to create a string object.It represents the sequence of characters. The operations which can be performed on strings are comparison, concatenation, conversion, etc…more…
C++ pointers
Pointers are one of the best features of C++ in comparison to other programming languages like Java, Python etc. It is a variable whose value is the address for another variable.We need to declare the variable as a pointer if we want to use pointers with variable…more…
C++ Structures
In C++, structure is a combination or group of different data elements that are grouped together under a single name.The data elements are known as data members who have different data type and length.It is a user defined data type that allows you to combine data items of different kinds…more…
C++ Enumeration
Enumerations are a user defined data type which consist integral constants. In this, you can specify a set of values for a variable and the variable can select only one out of the set. It has a fixed set of constants.To define enumerations we use ‘enum’ keyword. Enumerations can be used to define days of a week, month, weathers, etc…more…
C++ Friend Functions
If we define a function as a friend function then the protected and privated data of a class can be accessed using the function.The friend can be a function, a function template or member function, a class or a class template…more…
C++ Virtual Functions
The virtual functions must be declared in the public section of the class.They are always defined in base class and overridden in derived class but it is not mandatory to override in derived class.The virtual functions should be accessed…more…
C++ Functions
Functions are a group of statements or set of statements that perform the task together. In C++, every program has at least a single function that is a main( ). The functions take the inputs and perform the task on those inputs…more…
C++ Function Overloading
Overloading means the use of the same thing for different purposes. Function Overloading is a most important feature of C++ in which two or more functions can have the same name but different parameters or arguments for the different tasks…more…
C++ Function Overriding
The function overriding means when the function has the same name, same return type and same parameters.The function overriding also means when the derived class defines the same function as defined in its base class…more…
C++ Time functions
In C++, the time( ) function will return the current calendar time as an object of type time_t.The C++ standard library does not provide a proper data type for date and time it inherits the structs and functions for date and time manipulation from C…more…
C++ Data Structures
In C++, it allows you to define variables like arrays which allow you to merge many data items of the same kind and structure is another user defined data type that allows you to merge the data items of different kinds…more…
C++ Objects & Classes
As C++ is a multi-paradigm programming language so, it supports different programming styles and it supports object oriented programming which helps us to divide the complex problems into smaller sets by creating objects…more…
C++ Constructors
The constructor is a member function of a class which initialized the objects of a class. The constructor will be called automatically when an object is created.The constructor has the same name as of the class and it does not have any return type…more…
C++ Operator Overloading
In C++, operator overloading is a compile time polymorphism in which the operator is overloaded to provide the special meaning to the user defined data type.It is used to overload the operator in C++ and perform the operation on the user defined data type…more…
C++ Objects & Functions
The class provides the blueprint for the objects so; objects are created from within the class. The objects of a class are declared exactly with the same sort of declaration that we declare the variables of basic types…more…
C++ Abstraction
The data abstraction is one of the most essential and important feature of object oriented programming in C++. The data abstraction means displaying only essential information and hiding the details…more…
C++ Encapsulation
In C++, the encapsulation is a process of combining data members and functions in a single unit known as class.This is to prevent the access to the data directly and the access to them is provided through the function of the class…more…
C++ Inheritance
Inheritance is also one of the most important features of Object Oriented Programming in C++.In inheritance, the child class inherits the properties and functionality of the parent class…more…
C++ Inheritance access control
When creating a derived class from a base class then, you can use different access specifiers to inherit the data members of the base class.The derived class can access all the non-private members of its base class. And the base class members that are not accessible…more…
C++ Multilevel & Multiple inheritance
In C++, we can not only derive a class from the base class but you can also derive a class from the derived class.Mulitlevel inheritance is one child class inheriting from another child class. This is known as multilevel inheritance…more…
C++ Polymorphism
Polymorphism means having many forms or we can say we can define the polymorphism as the ability to display a message in many form.It happens when there is a hierarchy of classes and they are related by inheritance. It also means that a call…more…
C++ Overloading
In C++, it allows you to specify more than one definition for function or operator within a same scope which is known as function overloading and operator overloading respectively…more…
C++ Interfaces
An interface is a group of related functionalities that can belong to any class. The interfaces are created using abstract class.Abstract classes are used to achieve the abstraction in C++ and abstraction in C++ is a process to hide the internal details and show functionality only…more…
C++ Dynamic memory allocation
Static Memory Allocation – In static memory allocation the memory is allocated for the named variables by the compiler. The size and data type of the storage must be known at the compile time…more…
C++ Preprocessor directive
The preprocessor directives are the lines that are included in a program which begins with the # and it is different from the typical source code.They are invoked by the compiler to process the programs before compilation…more…
C++ Namespaces
In C++, namespaces allow us to group named entities that have global scope into narrower scope giving them namespace scope.It is like a container for identifiers and it put the name of its members in a distinct space so that they don’t conflict with the names in other namespaces or global namespace…more…
C++ Templates
Template is an important and powerful feature in C++. It is used to pass the data type as a parameter so that you don’t need to write same code for different data types.It allows you to define the generic classes and generic functions and thus provides support for generic programming…more…
C++ File handling
In C++, file handling is done using file streams where file means it is used to store the information or data and streams refer to sequence of bytes.In files we store data i.e. text or binary data permanently and use these data to read and write in the form…more…
C++ Exception handling
An exception is an error that arises during the execution of a program. In C++, the exception is an event which is occurred at the runtime.The exceptions are derived from std::exception class. It is a runtime error which can be handled and if they are not handled…more…
C++ Signal handling
Signals are the interrupts which force the operating system to stop the ongoing tasks and attend the task for which the interrupt has been sent.These interrupt can pause a service in any program of an operating system. In C++, various signals…more…