codescracker


c++

C++ Tutorial



« CodesCracker Home Next Tutorial »


This tutorial will teach you all about C++ programming from very basic for beginner to advance.

What is C++ ?

C++ is a case-sensitive, general-purpose, object-oriented programming language.

A Brief History of C++

C++ programming language was developed at the AT&T Bell Laboratories by Bjarne Stroustrup in the year 1980. He found 'C' lacking for simulations ((computing) the technique of representing the real world by a computer program) and decided to extend the language by adding some features from his favourite language named Simula 67.

The Simula 67 language was one of the earliest object-oriented language. Originally, Bjarne Stroustrup called it as "C with Classes".

The name C++ was coined by Rick Mascitti. In C++, the "++" is an increment operator of C language. Ever since its birth, C++ evolved to cope with problems encountered by the users, and through discussions at AT&T.

Why C++ is so Popular ?

The major reason behind the success and popularity of C++ is, it supports the object oriented technology, the latest in the software development and the most near to the real world.

C++ is an Object-Oriented Programming Language

C++ supports object-oriented programming, including the following four pillars of object-oriented development:

A Simple C++ Program

Here is a simple program in C++

/* C++ Tutorial - C++ Programming Tutorial */

#include<iostream.h>
#include<conio.h>
/* C++ comment */
void main()
{
	clrscr();   // to clear the screen
	cout<<"C++ Tutorial at codescracker.com";
	getch();
}

When the above C++ program is compile and executed, it will produce the following output :

c++ tutorial

Let's look at one more C++ example program.

/* C++ Programming Tutorial - C++ Tutorial with Examples */
		
#include<iostream.h>
#include<conio.h>
void main()
{
	clrscr();
	char user[20];
	cout<<"Enter Your Name : ";
	cin>>user;
	cout<<"Hello, "<<user;
	cout<<"\nYou are learning C++ programming at codescracker.com";
	getch();
}

Here is the sample run of this C++ program.

c++ programming tutorial

You will learn all about C++ programming, one by one, in this tutorial series. This tutorial series is divided into following chapters:

C++ Programming Basics Tutorial
Homepage of C++ Tutorial Environment Setup for C++ Programming
Character Set in C++ Keywords in C++
Identifiers in C++ Constants in C++
Punctuators in C++ Structure of C++ Program
Syntax of C++ Program Comments in C++
Basic Programs in C++ Input and Output Operator in C++
Input and Output Stream in C++
C++ Programming Data Types and Variables Tutorial
Data Types in C++ Data Type Modifiers in C++
Variables in C++ Variable Types in C++
Variable Scope in C++ Storage Classes in C++
Formatting Output Screen in C++
C++ Programming Operators Tutorial
Operators in C++ Type Conversion in C++
Numbers in C++ Assignment Operator in C++
Shorthands in C++
C++ Programming Flow of Control Tutorial
Statements in C++ Flow Control in C++
Decision Making in C++ if if-else if-else-if switch in C++
Loops in C++ for while do-while Loop in C++
break continue goto in C++
C++ Programming Standard Library Functions Tutorial
Standard Library Functions in C++ Header Files in C++
Character and String Functions in C++ Mathematical Functions in C++
C++ Programming Functions Tutorial
Functions in C++ Function Types in C++
Function Prototype Definition in C++ Function Call in C++
Function Return in C++ Scope Rules in C++
C++ Programming Arrays and Strings Tutorial
Arrays in C++ One Dimensional Arrays in C++
Two Dimensional Arrays in C++ Strings in C++
C++ Programming Data Structure Tutorial
Data Structure in C++ Access Structure Member in C++
Nested Data Structure in C++ Structure Array in C++
Pass Structure to Function in C++ typedef in C++
#define in C++
C++ Programming Pointers Tutorial
Pointers in C++ Memory Map in C++
Free Store in C++ Declare and Initialize Pointers in C++
Dynamic Memory Allocation in C++ Pointers and Arrays in C++
Pointers and Const in C++ Pointers and Functions in C++
Pointers and Structures in C++ Objects as Function Arguments in C++
Pointers and Objects in C++ References in C++
C++ File Handling Tutorial
File Handling in C++ File Streams in C++
Data Files in C++ Opening and Closing Files in C++
Steps to Process Files in C++ Change Stream Behaviour in C++
Sequential I/O Operations in C++ Detecting EOF in C++
File Pointers and Random Access in C++ Binary Files Operations in C++
Error Handling in C++
C++ Programming Object Oriented Tutorial
Object Oriented Programming in C++ Function Overloading in C++
Classes and Objects in C++ Constructors and Destructors in C++
Inheritance in C++ Encapsulation in C++
Polymorphism in C++ Data Abstraction in C++
Interfaces in C++
C++ Programming Advance Tutorial
Linked Lists in C++ Stacks in C++
Queues in C++ Date Time in C++
Preprocessors in C++ Exception Handling in C++
Namespaces in C++ Dynamic Memory in C++
Multithreading in C++ Templates in C++
Signal Handling in C++ Web Programming in C++
C++ Programming Examples
Homepage of C++ Programming Examples Print Hello World in C++
Get Input from User in C++ Print Integer in C++
Add two Numbers in C++ Add Number's Digits in C++
Check Even or Odd in C++ Check Prime or Not in C++
Check Alphabet or Not in C++ Check Vowel or Not in C++
Check Leap Year or Not in C++ Check Reverse equal Original in C++
Add, Subtract, Multiply and Divide in C++ Make Calculator in C++
Add Digits of Number in C++ Calculate Average and Percentage Marks in C++
Calculate Arithmetic Mean in C++ Calculate Student's Grade in C++
Print Table of Number in C++ Print Prime Numbers in C++
Add n Numbers in C++ Interchange Numbers in C++
Reverse Numbers in C++ Swap two Numbers in C++
Count Positive, Negative and Zero in C++ Find Largest of two Numbers in C++
Find Largest of three Numbers in C++ Find Factorial of Number in C++
Find HCF and LCM in C++ Calculate Area and Perimeter in C++
Calculate Area and Circumference in C++ Convert Fahrenheit to Centigrade in C++
Convert Centigrade to Fahrenheit in C++ Print ASCII Values in C++
Print Fibonacci Series in C++ Check Palindrome or Not in C++
Check Armstrong or Not in C++ Generate Armstrong Numbers in C++
Find ncR and nPr in C++ Convert Decimal to Binary in C++
Convert Decimal to Octal in C++ Convert Decimal to Hexadecimal in C++
Convert Binary to Decimal in C++ Convert Binary to Octal in C++
Convert Binary to Hexadecimal in C++ Convert Octal to Decimal in C++
Convert Octal to Binary in C++ Convert Octal to Hexadecimal in C++
Convert Hexadecimal to Decimal in C++ Convert Hexadecimal to Binary in C++
Convert Hexadecimal to Octal in C++ Star Pyramid Pattern Programs in C++
Print Diamond Pattern in C++ Print Floyd Triangle in C++
Print Pascal Triangle in C++ Print Smiling Face in C++
One Dimensional Array Program in C++ Linear Search in C++
Binary Search in C++ Add Two Numbers using Pointer in C++
Find Largest Element in Array in C++ Find Smallest Element in Array in C++
Reverse Array in C++ Insert Element in Array in C++
Delete Element from Array in C++ Merge two Array in C++
Bubble Sort in C++ Selection Sort in C++
Insertion Sort in C++ Two Dimensional Array Program in C++
Add two Matrices in C++ Subtract Matrices in C++
Transpose Matrix in C++ Multiply two Matrices in C++
Three Dimensional Array Program in C++ Print String in C++
Find Length of String in C++ Compare two String in C++
Copy String in C++ Concatenate String in C++
Reverse String in C++ Delete Vowels from String in C++
Delete Words from Sentence in C++ Count Character in String in C++
Count Word in Sentence in C++ Remove Spaces from String in C++
Sort a String in C++ Convert Uppercase to Lowercase in C++
Convert Lowercase to Uppercase in C++ Swap two Strings in C++
Check Anagram or Not in C++ Generate Random Numbers in C++
Read File in C++ Write to File in C++
Read and Display File in C++ Copy File in C++
Merge two File in C++ List Files in Directory in C++
Delete File in C++ Encrypt and Decrypt Files in C++
Print Date in C++ Get IP Address in C++
Shutdown and Restart Computer in C++

« CodesCracker Home Next Tutorial »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test