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 tell whether a program was compiled using C versus C++?

The ANSI standard for the C language defines a symbol named __cplusplus that is defined only when you
are compiling a C++ program. If you are compiling a C program, the __cplusplus symbol is undefined.
Therefore, you can check to see whether the C++ compiler has been invoked with the following method:

#ifdef __cplusplus                      /* Is __cplusplus defined? */
#define USING_C FALSE                   /* Yes, we are not using C */
#define USING_C TRUE                    /* No, we are using C */

When the preprocessor is invoked, it sets  USING_C to FALSE if the  __cplusplus symbol is defined. Otherwise,
if __cplusplus is undefined, it sets USING_C to TRUE. Later in your program, you can check the value of the
USING_C constant to determine whether the C++ compiler is being used.

Do you know that?

49% of freelancers have not felt the impacts of the economic downturn Next


Getting payments for Freelancers
1. Read how to register and get earned money

2. Open account within 5 minPayoneer sing up to get free $25