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.
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.
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().
Relational operators refer to relationship between values with one another.
They result in logical true or false. 1 represents true, 0 represents false.
We can declare a variable in a class but can only initialize it using constructor in a class.
Operators that act on one & two operand(s) are referred to as Unary Operators & Binary Operators, respectively.
The code shows a class student. It contains two private members rno and name. The private members are accessed by the public member functions.
Encapsulation may be defined as binding of data members and member functions into a single unit called class.