Presentation is loading. Please wait.

Presentation is loading. Please wait.

Hierarchy of C++ data types. Hierarchy of C++ data types Contd.. Note : The modifies signed, unsigned, long and short may be applied to character and.

Similar presentations


Presentation on theme: "Hierarchy of C++ data types. Hierarchy of C++ data types Contd.. Note : The modifies signed, unsigned, long and short may be applied to character and."— Presentation transcript:

1 Hierarchy of C++ data types

2 Hierarchy of C++ data types Contd.. Note : The modifies signed, unsigned, long and short may be applied to character and integer basic data types, long may also be applied to double.

3 Water-fall Model of type conversion

4 OPERATOR OVERLOADING means assigning different meaning to an operation depending on the context. e.g. gives the value pointed to by the pointer used for multiplying two numbers The number and type of operands decide the nature of operation to follow.

5 OPERATOR OVERLOADING Contd.. > are good examples of operator overloading. //display a double type value. cout <<75.86; // displays a string by invoking depth of char type

6 OPERATOR OVERLOADING Contd.. Note : None of these definitions affect the built-in meaning of the operator. Almost all C++ opeators can be overloaded with a few exceptions such as the member-access operators (- and.*), conditional operator (? :), Scope resolution operator (: :) and the size operator (size of).

7 OPERATOR OVERLOADING Contd..

8 Basic Control Structure C++ supports all three basic control structures with the object-oriented paradigm. (C++ combines the power of structured programming with the Object-Oriented paradigm).

9 The if Statement Simple if if.... else

10 Form 1 if (expression is true) { action 1, } action 2 ; action 3 ;

11 Form 2 if (expression is true) { action 1; } else { action 2 ; } action 3 ;

12 Form 3 Switch (expression) { case 1: { action 1; } case 2: { action 2; }.

13 Form 3 default : { action n; } action n+1;

14 LOOPING STATEMENT STRUCTURE do-while Statement While Statement (exit-controlled) (entry-controlled) do While (condition is true) {{ action 1; } while (condition is true); } action 2; action 2;

15 LOOPING STATEMENT STRUCTURE For statement (entry-controlled) for (initial value; test; increment) { action 1; } action 2;


Download ppt "Hierarchy of C++ data types. Hierarchy of C++ data types Contd.. Note : The modifies signed, unsigned, long and short may be applied to character and."

Similar presentations


Ads by Google