what is demotion in c++?

binusasi at 07h34
02
Feb
2012
what is demotion in c++?

Demotion:
Demotion occurs whenever a variable or expression of a larger type gets converted to
smaller type. Bye default, a floating point number is considered as a double number in C++.
int a=7.5 // double gets down – converted to int ;
int b=7.0f ; // float gets down – converted to int
char c=b ; // int gets down – converted to char
Standard Automatic demotion can result in the loss of information. In the first examp
About
This topic belongs to the forum
  • Numbers of topics : 336054
  • Numbers of messages : 510507
  • Numbers of users : 1822
  • Numbers of points : 227298
Forums from same category
Informations

0 Replies For the topic :
"what is demotion in c++?"

This topic has been viewed 13 times.

Last message :
02/02/2012 at 07h34 by "binusasi"