CPP

28
1572 reads

February 8, 2013

Logical Operators


The logical operators, logical AND (&&) and logical OR (||), are used to combine multiple conditions formed using relational or equality expressions.

46
1646 reads

February 8, 2013

Arithmetic Operators


Operations of addition, subtraction, multiplication and division literally correspond with their respective mathematical operators.

48
1468 reads

February 8, 2013

Greatest of three variables by using '&&' and '>' operator


The operator '&&' corresponds with Boolean logical operation AND. This operation results true if both its two operands are true, and false otherwise.

44
1584 reads

February 8, 2013

Swapping values using assignment operator


The assignment operator assigns a value to a variable.

a = 5;

222
3905 reads

February 8, 2013

Constructors


A class constructor is a special member function of a class that is executed whenever we create new objects of that class.

143
1711 reads

February 8, 2013

Member Function of class


This example demonstrates the definition and the usage of a class member function. It is a function that has its definition or its prototype within the class definition like any other variable.

35
1701 reads

February 8, 2013

Classes Introduction


This example demonstrates the defining and instantiation of a class and the usage of its member variables.

44
1703 reads

February 8, 2013

Passing Variables to Functions


This example demonstrates passing arguments by reference and by value to functions.

Pass By Reference :

30
1762 reads

February 8, 2013

Static Variables


This example demonstrates static variables. Static variables retain their values and are not destroyed even after they go out of scope.

252
2992 reads

February 8, 2013

Data Types


This example demonstrates the sizeof operator on different types. Below are the datatypes, their sizes and their range.

Data Types :
char:
Typical Bit Width : 1 byte