Joke Collection Website - Joke collection - OP jokes c language bosses
OP jokes c language bosses
Sizeof is a C/C++ operator, which tests the number of bytes occupied by the type. It only takes the "type" of the expression in (), so sizeof(2.5)(2.5 can be any legal data with decimal point) is equivalent to sizeof(double) here.
According to C/C++, constants with decimal points default to double(8 bytes) instead of float(4 bytes), so the values of sizeof(2.5) and sizeof(double) are both 8.
If you want to make the floating-point constant float, you should follow the data with f or f, indicating that the floating-point constant is float. For example, if sizeof(2.5) here is written as sizeof(2.5f), then its value is 4.
At present, there are two common definitions of floating-point data in C/C++. One is float, which is represented by 4 bytes, and the other is double, which is represented by 8 bytes.
- Previous article:Why don't people nowadays like to use substitution words in their names?
- Next article:What if you have no dignity as a waiter?
- Related articles
- Jokes about foggy days.
- What do you mean by rhetoric? Rhetorical interpretation.
- The "elixir of life" was excavated from the tombs of the Western Han Dynasty. Can it really make people live forever?
- Classic quotations that have nothing to say
- Which variety show guests' "divine reply" can make you laugh at internal injuries?
- What kind of experience is the failure of postgraduate entrance examination?
- What do you think is the most romantic thing for couples to pick up their wives by bike after a party and envy their classmates around them?
- The sweet talk routine of chasing girls
- What kind of company is Tesco in Tangxian County?
- The main contents of A Little Worth Ten Thousand Gold