Basic data type | object oriented programming with C++

Basic Data type in C++ can be classified under various category is showing in this image.. this image showing basic data types of C++.

Both C and C++ compiler support the all bit is also known as basic or fundamental data type with the expression off white basic data type may have several modifiers preceding them to server the needs of various situations the modifier signed unsigned long and sort may be applied to character and integer basic data type the modifier long may also be applied to type representation is machine is specified in C++.

For the type void was introduction in ANSI C. Two normal user of void(1) are to specify the return type of a functions when it not returning any value and(2) to indicated an empty arguments list a to a function example:

Void  funct1(void);

Another interesting use of view Void is in the declaration of generic pointer for example:

Void *gp;. 
            // gp become generic pointer

A generic pointer can be assigned a pointer value of any basic data type but it many not me differentiate for example:

Int *ip;.     
  // Int pointer

gp. = ip;.         // Assign int pointer to void pointer

Are valid statements but the statement,

*ip = *gp;

It illegal , it would not make sense to difference appointed to a void value.

Post a Comment