Questions 1 - 9 of 9
Close
Flag this interview question as inappropriate Inappropriate
See Answer
Templates allow to create generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types. Until certain point they fulfill the functionality of a macro.
Create Date
:
Sunday, April 27, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
Yes, I do. A macro is intended to help automate some of the redundant computations and processes by recording it under a macro name. An example would be a s series of formulas that you record and assign under one macro. All you need to do is to call on that macro when needed.
Create Date
:
Saturday, April 12, 2008
Asked At
:
None
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
#define cat(x,y) x##y concatenates x to y. But cat(cat(1,2),3) does not expand but gives preprocessor warning. Why?

in this case the cat(x,y) is the macro which is defined by using the preprocessor directive , this will be substituted only at the place where it is called in this example it happens like this

cat(1,2)##3 which will once again become 1##2##3
here if we use ## in between we can join or concatenat only two variables that why it gives a preprocessor warning
Create Date
:
Sunday, March 16, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (1) :
1.
dk
Sunday, March 16, 2008 9:37 PM
is this really an interview question..?
why complicate ?
Flag this interview question as inappropriate Inappropriate
See Answer
Templates allow to create generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types. Until certain point they fulfill the functionality of a macro. Its prototype is any of the two following ones:  template <class indetifier> function_declaration; template <typename indetifier> function_declaration;the only difference between both prototypes is the use of keyword class or typename, its use is indistinct since both expressions have exactly the same meaning and behave exactly the same way.
Create Date
:
Saturday, March 15, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
A macro is a preprocessor directive that provides a mechanism for token replacement in your source code. Macros are created by using the #define statement.  Here is an example of a macro: Macros can also utilize special operators such as the stringizing operator (#) and the concatenation operator (##).The stringizing operator can be used to convert macro parameters to quoted strings, as in the following example: #define DEBUG_VALUE(v) printf(#v " is equal to %d.n", v)
In this program, we can check the value of a variable by invoking the DEBUG_VALUE macro: int x = 20; DEBUG_VALUE(x);  The preceding code prints "x is equal to 20." on-screen. This example shows that the stringizing operator used with macros can be a very handy debugging tool.
Create Date
:
Saturday, March 15, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
NULL is a macro defined in for the null pointer.
NUL is the name of the first character in the ASCII character set. It corresponds to a zero value. There's no standard macro NUL in C, but some people like to define it.
NULL is defined as ( void *)0
Create Date
:
Tuesday, September 11, 2007
Asked At
:
None
Job Positions
:
None
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer