C/C++ Compiler Language Extensions
Conditional Expressions with Missing Operands
The middle operand of a conditional operator can be left out. If the con-
dition is non-zero (true), then the condition itself is the result of the
expression. This can be used for testing and substituting a different value
when a pointer is NULL. The condition is only evaluated once; therefore,
repeated side effects can be avoided. For example,
printf("name = %s\n", lookup(key)?:"-");
calls
lookup()
is an extension to C, provided for compatibility with GCC. It is not
allowed in C++ mode.
Hexadecimal Floating-Point Numbers
C99 style hexadecimal floating-point constants are accepted. They have
the following syntax.
hexadecimal-floating-constant:
{0x|0X} hex-significand binary-exponent-part [ floating-suffix ]
hex-significand: hex-digits [ . [ hex-digits ]]
binary-exponent-part: {p|P} [+|-] decimal-digits
floating-suffix: { f | l | F | L }
The hex-significand is interpreted as a hexadecimal rational number. the
digit sequence in the exponent part is interpreted as a decimal integer. The
exponent indicates the power of two by which the significand is to be
scaled. The floating suffix has the same meaning it does for decimal float-
ing constants: a constant with no suffix is of type
suffix
is of type
F
.
double
Hexadecimal floating constants enable the programmer to specify the
exact bit pattern required for a floating-point constant. For example, the
declaration
1-142
once, and substitutes the string "-" if it returns NULL. This
, and a constant with suffix
float
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
, a constant with
double
is of type
L
long
for ADSP-219x DSPs
Need help?
Do you have a question about the VISUALDSP++ 3.5 and is the answer not in the manual?
Questions and answers