write a program that explain #define and # undef directive



write a program that explain #define and # undef directive..

Answer / ravi joshi

The following code snippet explain the use of #define and
#undef preprorcessor directives.

/* define our own value of NULL */
#ifdef NULL
#undef NULL /* if NULL is already defined, then
undefine it */
#define NULL ((void*)0) /* define our own version of NULL
#endif

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More C Interview Questions

what is the use of c program?

4 Answers   Synergy, Web Synergies,


What is dynamic variable in c?

0 Answers  


What is adt in c programming?

0 Answers  


Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

2 Answers   Cap Gemini, HCL,


write a programe returns the number of times the character appears in the string

2 Answers  






How can I rethow can I return a sequence of random numbers which dont repeat at all?

0 Answers  


6. Which of the Following is not defined in string.h? A)strspn() B)strerror() C)memchr() D)strod()

2 Answers   Accenture,


A function 'q' that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as: A)int (*q(char*)) [] B)int *q(char*) [] C)int(*q)(char*) [] D)None of the Above

2 Answers   Accenture,


what is pointer?

4 Answers  


What is sizeof in c?

0 Answers  


program to find the second largest word in a paragraph amongst all words that repeat more thn twice

4 Answers   CTS, iGate,


You have an int array with n elements and a structure with three int members. ie struct No { unsigned int no1; unsigned int no2; unsigned int no3; }; Point1.Lets say 1 byte in the array element is represented like this - 1st 3 bits from LSB is one number, next 2 bits are 2nd no and last 3 bits are 3rd no. Now write a function, struct No* ExtractNos(unsigned int *, int count) which extracts each byte from array and converts LSByte in the order mentioned in point1.and save it the structure no1, no2, no3. in the function struct No* ExtractNos(unsigned int *, int count), first parameter points to the base address of array and second parameter says the no of elements in the array. For example: if your array LSB is Hex F7 then result no1 = 7, no2 = 2, no3 = 7. In the same way convert all the elements from the array and save the result in array of structure.

2 Answers   Qualcomm,


Categories