Introduction to c ++
Introduction to C++ Programming
Language
Getting Started
C++ Programming Language
C++ is a middle-level programming language developed by Bjarne Stroustrup starting in
1979 at Bell Labs. C++ runs on a variety of platforms, such as Windows, Mac OS, and
the various versions of UNIX. This C++ tutorial adopts a simple and practical approach
to describe the concepts of C++ for beginners to advanced software engineers.
Discussion
C++ is a MUST for students and working professionals to become a great Software
Engineer. Here are some of the key advantages of learning C++:
•
C++ is very close to hardware, so you get a chance to
work at a low level which gives you lot of control in terms
of memory management, better performance and finally a
robust software development.
•
C++ programming gives you a clear understanding about
Object Oriented Programming. You will understand low
level implementation of polymorphism when you will
implement virtual tables and virtual table pointers, or
dynamic type identification.
•
C++ is one of the every green programming languages
and loved by millions of software developers. If you are a
great C++ programmer then you will never sit without work
and more importantly you will get highly paid for your
work.
•
C++ is the most widely used programming languages in
application and system programming. So you can choose
your area of interest of software development.
•
C++ really teaches you the difference between compiler,
linker and loader, different data types, storage classes,
variable types their scopes etc.
C++ is a statically typed, compiled, general-purpose, case-sensitive, free-form
programming language that supports procedural, object-oriented, and generic
programming.
C++ is regarded as a middle-level language, as it comprises a combination of both highlevel and low-level language features.
C++ was developed by Bjarne Stroustrup starting in 1979 at Bell Labs in Murray Hill,
New Jersey, as an enhancement to the C language and originally named C with
Classes but later it was renamed C++ in 1983.
C++ is a superset of C, and that virtually any legal C program is a legal C++ program.
Note − A programming language is said to use static typing when type checking is
performed during compile-time as opposed to run-time.
Object-Oriented Programming
C++ fully supports object-oriented programming, including the four pillars of objectoriented development −
•
•
Encapsulation
•
•
•
Data hiding
Inheritance
Polymorphism
Standard Libraries
Standard C++ consists of three important parts −
•
•
•
The core language giving all the building blocks including
variables, data types and literals, etc.
The C++ Standard Library giving a rich set of functions
manipulating files, strings, etc.
The Standard Template Library (STL) giving a rich set of
methods manipulating data structures, etc.
The ANSI Standard
The ANSI standard is an attempt to ensure that C++ is portable; that code you write for
Microsoft’s compiler will compile without errors, using a compiler on a Mac, UNIX, a
Windows box, or an Alpha.
The ANSI standard has been stable for a while, and all the major C++ compiler
manufacturers support the ANSI standard.
Learning C++
The most important thing while learning C++ is to focus on concepts.
The purpose of learning a programming language is to become a better programmer;
that is, to become more effective at designing and implementing new systems and at
maintaining old ones.
C++ supports a variety of programming styles. You can write in the style of Fortran, C,
Smalltalk, etc., in any language. Each style can achieve its aims effectively while
maintaining runtime and space efficiency.
Use of C++
C++ is used by hundreds of thousands of programmers in essentially every application
domain.
C++ is being highly used to write device drivers and other software that rely on direct
manipulation of hardware under realtime constraints.
C++ is widely used for teaching and research because it is clean enough for successful
teaching of basic concepts.
Hello World using C++
C++ is a super set of C programming with additional implementation of object-oriented
concepts.
#include
using namespace std;
// main() is where program execution begins.
int main() {
cout