What is the difference between macros and inline functions?

Answer Posted / rahul sharma

Macro is a must do thing whearas inline is a hint to the compiler. he may choose not to inline if the function seems complex (it uses recursion or many loops)

Macro can have side effects e.g. the typical
SQUARE(++i); problem

but these problem are not there in inline functions

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above

1736


How is a null pointer different from a dangling pointer?

763


Why do we use pointer to pointer in c?

792


an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational

1043


Why doesnt long int work?

784






Is that possible to store 32768 in an int data type variable?

861


What are called c variables?

749


Where does the name "C" come from, anyway?

844


Where define directive used?

791


What is a stream in c programming?

802


What is #include stdlib h?

838


What is c variable?

765


How can I manipulate individual bits?

779


Under what circumstances does a name clash occur?

912


What is putchar() function?

832