C Datastructures Networking OS

Saturday 1 February 2014

TYPE COMPATIBILITY:
         C++ defines int,short int ,long int as three different types.Hence they must be cast when their values assigned to one another.
The types of values must be the same for compatibility or else a cats must be applied.

DIFFERENCES IN STORING CHAR CONSTANTS IN C AND C++:
     In C  char constant is considered as interger:
        for example,
                        sizeof('x') returns sizeof(int)
                         i.e size of ASCII value of x is returned
   Whereas in C++,char is not promoted to integer
                       sizeof('x')  returns sizeof(char)

No comments:

Post a Comment