You can use it as a sort of assertion that an expression has arithmetic type:
#define CHECK_ARITHMETIC(x) (+(x))
This will generate a compile-time error if x
evaluates to (say) a pointer.
That is about the only practical use I can think of.
More Related Contents:
- Not able to calculate in C.How do you calculate in C?
- Are compound statements (blocks) surrounded by parens expressions in ANSI C?
- Parameter evaluation order before a function calling in C [duplicate]
- C comma operator
- Best and shortest way to evaluate mathematical expressions
- C: unary minus operator behavior with unsigned operands
- How to printf a memory address in C
- What does i = (i, ++i, 1) + 1; do?
- Compound condition in C: if (0.0 < a < 1.0)
- Why isn’t “k” incremented in the statement “m = ++i && ++j || ++k” when “++i&&++j” evaluates to true? [duplicate]
- C : is there “lazy evaluation” when using && operator, as in C++?
- C fundamentals: double variable not equal to double expression?
- Explanation of output of this C code
- How does this foo function works?
- code ran into segmentation fault error.how to fix? [closed]
- Splitting a string into words
- Concept of void pointer in C programming
- How to declare strings in C [duplicate]
- What happens to a float variable when %d is used in a printf?
- What is the function of “(void) (&_min1 == &_min2)” in the min macro in kernel.h?
- Why does integer division by zero result in a floating point exception?
- Algorithm to rotate an image 90 degrees in place? (No extra memory)
- How do I run a C program from VIM?
- What are the implications of the linux __user macro?
- How to include a dynamic array INSIDE a struct in C?
- What is the correct printf specifier for printing pid_t
- Open directory using C
- AES (aes-cbc-128, aes-cbc-192, aes-cbc-256) encryption/decryption with openssl C
- Use a dope vector to access arbitrary axial slices of a multidimensional array?
- Exceeding array bound in C — Why does this NOT crash?