cplusplus summaries

1
C++ summaries vector is a template class in c++ There are new features in c++ 11 e.g. ranged for loops used for going through the entire vector elements. So long as two declarations have different scope it will not affect the compilation of the code. Brace brackets tend to end scopes in c++. Member functions of vector e.g. push-back. There are a couple of free functions e.g. sort(), count() etc There cout<< and cin>> objects for the iostream classes Operator overloads String, iostream etc are all classes which are found the standard library of C++ String is a class and you can make instances or objects of the class e.g. name, course etc, while iostream is used to put characters unto the screen. A class is a definition of a user-defined type. When you write a type, you write instructions to the compiler explaining what the class does, knows, receives etc The constructor function has the same name as the class and it is usually declared in the public domain, it has no return type because it is the constructor of the class. All function of the class should be in the public The scope resolution operator:: helps to resolve the scope of a function or variable name.

Upload: ugwu-emmanuel

Post on 11-Jan-2016

212 views

Category:

Documents


0 download

DESCRIPTION

good

TRANSCRIPT

Page 1: Cplusplus Summaries

C++ summaries

vector is a template class in c++ There are new features in c++ 11 e.g. ranged for loops used for going through the entire vector elements. So long as two declarations have different scope it will not affect the compilation of the code. Brace brackets tend to end scopes in c++. Member functions of vector e.g. push-back. There are a couple of free functions e.g. sort(), count() etc There cout<< and cin>> objects for the iostream classes Operator overloads String, iostream etc are all classes which are found the standard library of C++ String is a class and you can make instances or objects of the class e.g. name, course etc, while iostream is

used to put characters unto the screen. A class is a definition of a user-defined type. When you write a type, you write instructions to the compiler

explaining what the class does, knows, receives etc The constructor function has the same name as the class and it is usually declared in the public domain, it

has no return type because it is the constructor of the class. All function of the class should be in the public

The scope resolution operator:: helps to resolve the scope of a function or variable name.