Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What are the differences between the macros and the functions?
Home
C Plus Plus
What are the differences between the macros and the functions?
0
votes
asked
Jan 7
in
C Plus Plus
by
GeorgeBell
What are the differences between the macros and the functions?
c-programming-interview-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jan 7
by
GeorgeBell
The differences between macros and functions can be explained as follows:
Macros
Functions
It is preprocessed rather than compiled.
It is compiled not preprocessed.
It is preprocessed rather than compiled.
Function checks for compilation errors.
Code length is increased.
Code length remains the same.
Macros are faster in execution.
Functions are a bit slower in execution.
Macros are useful when a small piece of code is used multiple times in a program.
Functions are helpful when a large piece of code is repeated a number of times.
Related questions
0
votes
Q: What are the differences between #include in C and import in Java?
asked
Jan 11
in
C Plus Plus
by
GeorgeBell
c-programming-interview-questions-answers
0
votes
Q: What are the Differences between ++*p, *p++ and *++p?
asked
Jan 9
in
C Plus Plus
by
GeorgeBell
c-programming-interview-questions-answers
0
votes
Q: What are differences between Source Codes from Object Codes?
asked
Jan 7
in
C Plus Plus
by
GeorgeBell
c-programming-interview-questions-answers
0
votes
Q: What is the difference between array and pointer?
asked
Jan 9
in
C Plus Plus
by
GeorgeBell
c-programming-interview-questions-answers
0
votes
Q: What is difference between i++ and ++i?
asked
Jan 9
in
C Plus Plus
by
GeorgeBell
c-programming-interview-questions-answers
0
votes
Q: What are header files and what are its uses in C programming?
asked
Jan 7
in
C Plus Plus
by
GeorgeBell
c-programming-interview-questions-answers
0
votes
Q: Can a variable be both const and volatile?
asked
Jan 9
in
C Plus Plus
by
GeorgeBell
c-programming-interview-questions-answers
0
votes
Q: Write a program to get the higher and lower nibble of a byte without using shift operator?
asked
Jan 7
in
C Plus Plus
by
GeorgeBell
c-programming-interview-questions-answers
0
votes
Q: What can be the smallest executable code in C Proramming?
asked
Jan 9
in
C Plus Plus
by
GeorgeBell
c-programming-interview-questions-answers
0
votes
Q: How to write your own sizeof operator?
asked
Jan 9
in
C Plus Plus
by
GeorgeBell
c-programming-interview-questions-answers
...