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 |
What are types of structure?
What is the difference between ‘g’ and “g” in C?
Consider a language that does not have arrays but does have stacks as a data type.and PUSH POP..are all defined .Show how a one dimensional array can be implemented by using two stacks.
Why is a semicolon (;) put at the end of every program statement?
State the difference between x3 and x[3].
how is the examination pattern?
How to calculate Total working time using Login and logout?
2 Answers CTS, Cygnus, Infosys, Signal Networks, TCS, Wipro,
Differentiate between ordinary variable and pointer in c.
What do you mean by dynamic memory allocation in c? What functions are used?
What is abstract data structure in c?
What will be result of the following program? void myalloc(char *x, int n) { x= (char *)malloc(n*sizeof(char)); memset(x,\0,n*sizeof(char)); } main() { char *g="String"; myalloc(g,20); strcpy(g,"Oldstring"); printf("The string is %s",g); } a) The string is : String b) Run time error/Core dump c) The string is : Oldstring d) Syntax error during compilation e) None of these
void main() { int i=5; printf("%d",i++ + ++i); }