Miscellaneous Operators

I l @ ve RuBoard

Miscellaneous Operators

sizeof yields the size, in units the size of a char value, of the operand to its right. Typically, a char value is one byte in size. The operand can be a type- specifier in parentheses, as in sizeof (float) , or it can be the name of a particular variable, array, or so on, as in sizeof foo . A sizeof expression is of type size_t .

(type) is the cast operator and converts the following value to the type specified by the enclosed keyword(s). For example, (float) 9 converts the integer 9 to the floating-point number 9.0 .

, is the comma operator; it links two expressions into one and guarantees that the left most expression is evaluated first. The value of the whole expression is the value of the right-hand expression. This operator is typically used to include more information in a for loop control expression.

Example

 for (step = 2, fargo = 0; fargo < 1000; step *= 2)         fargo += step; 
I l @ ve RuBoard


C++ Primer Plus
C Primer Plus (5th Edition)
ISBN: 0672326965
EAN: 2147483647
Year: 2000
Pages: 314
Authors: Stephen Prata

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net