Interview answers verified by specialists.

Find interview questions and answers on this website:

See right interview answers on 30 common job interview questions

How can you check to see whether a symbol is defined?

You can use the #ifdef and #ifndef preprocessor directives to check whether a symbol has been defined
(#ifdef) or whether it has not been defined (#ifndef). Many programmers like to ensure that their own
version of NULL is defined, not someone else's. This task can be accomplished as shown here:

#ifdef NULL
#undef NULL
#define NULL (void*) 0

The first line, #ifdef NULL, checks to see whether the NULL symbol has been defined. If so, it is undefined
using #undef NULL and the new definition of NULL is defined.

To check whether a symbol has not been defined yet, you would use the #ifndef preprocessor directive.

Do you know that?

$46 average hourly rates for Web Designer freelance Next


Fast Payments
Payoneer sing up to get free