ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
What is the Difference between Macro and ordinary 
definition?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is the Difference between Macro and ordinary definition?
Answer
# 1
1. Macro takes parameters where as ordinary definition does 
not.
2. Based on the parameter values to macro it can result in 
different value at run time. Ordinary defination value 
remains same at all place at run time.
3. Macro can be used for conditional operations where as 
definition can not.
4. Using macro one can achieve inline functionality in C 
ie. macro can be a function performing simple operations. 
This is not possible using definitions.
 
Is This Answer Correct ?    3 Yes 4 No
D G Patel
 
  Re: What is the Difference between Macro and ordinary definition?
Answer
# 2
macro definitions can be used for conditional compilation
whereas ordinary cannot
 
Is This Answer Correct ?    2 Yes 4 No
Himanshu Goel
 
 
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
What is #pragma directive?how it is used in the program? what is its advantages and disadvantages?  1
what's the o/p int main(int n, char *argv[]) { char *s= *++argv; puts(s); exit(0); } Motorola1
Write a C program that reads a series of strings and prints only those ending in "ed"  2
write a c program to check weather a particluar bit is set or not? IBM4
what does data structure mean?  7
12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV Accenture4
which one of follwoing will read a character from keyboard and store in c a)c=getc() b)c=getchar() c)c=getchar(stdin) d)getc(&c) e)none  5
what is disadvantage of pointer in C Tech-Mahindra5
What is the difference between static and global variables?  1
What's wrong with "char *p = malloc(10);" ?  4
pointer_variable=(typecasting datatype*)malloc(sizeof(datatype)); This is the syntax for malloc?Please explain this,how it work with an example? Excel2
What is the function of ceil(X) defined in math.h do? A)It returns the value rounded down to the next lower integer B)it returns the value rounded up to the next higher integer C)the Next Higher Value D)the next lower value Accenture3
Find the middle node in the linked list?? (Note:Do not use for loop, count and count/2) Subex2
write a fuction for accepting and replacing lowercase letter to'Z' with out using inline function. Temenos4
11. Look at the Code: #include<string.h> void main() { char s1[]="abcd"; char s2[10]; char s3[]="efgh"; int i; clrscr(); i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,"abcd")); printf("%d",i); } What will be the output? A)No output B) A Non Integer C)0 D) Garbage Accenture7
is compiler do read the data line by line or not. ?? LG-Soft3
what is out put of the following code? #include class Base { Base() { cout<<"constructor base"; } ~Base() { cout<<"destructor base"; } } class Derived:public Base { Derived() { cout<<"constructor derived"; } ~Derived() { cout<<"destructor derived"; } } void main() { Base *var=new Derived(); delete var; } Honeywell2
main() { printf("hello%d",print("QUARK test?")); }  4
program to find the roots of a quardratic equation  1
What is alloca() and why is its use discouraged?  1
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com