CPP

30
1708 reads

February 8, 2013

Class with Friend function


This code shows a class myclass with private members a and b. A friend function is declared in global scope. This function is made friend to myclass.

40
1812 reads

February 8, 2013

Class with Copy initialization


The code shows a class Mynum. It contains six private data members - m1, m2, m3, m4, rno and name. There is also a private member function calc().

141
2743 reads

February 8, 2013

Brief Description of Operators - Logical, Relational


Relational operators refer to relationship between values with one another.
They result in logical true or false. 1 represents true, 0 represents false.

25
1759 reads

February 8, 2013

Initialization


We can declare a variable in a class but can only initialize it using constructor in a class.

373
3222 reads

February 8, 2013

Brief Description of Operators - Arithmetic, Increment/Decrement


Operators that act on one & two operand(s) are referred to as Unary Operators & Binary Operators, respectively.

24
1741 reads

February 8, 2013

Class with Members and Object


The code shows a class student. It contains two private members rno and name. The private members are accessed by the public member functions.

35
1630 reads

February 8, 2013

Explicit Type Casting Operator


Type casting operators :

31
2234 reads

February 8, 2013

Encapsulation


Encapsulation may be defined as binding of data members and member functions into a single unit called class.

23
1787 reads

February 8, 2013

Class Concept


Class may be defined as a collection of data members and member functions.

26
1617 reads

February 8, 2013

Conditional Operator


Conditional operator ( ? )