Q: What is the mandatory part to present in function pointers?
Solution: The data types are mandatory for declaring the variables in the function pointers.
Q: which of the following can be passed in function pointers?
Solution: Only functions are passed in function pointers.
Q: What is the meaning of the following declaration? int(*ptr[5])();
Solution: In this expression, ptr is array not pointer.
Q: which keyword is used to define the macros in c++?
Solution: #define is the keyword which is used to define the macros in c++.
Q: Which symbol is used to declare the preprocessor directives?
Solution: # symbol is used to declare the preprocessor directives.
Q: How many types of macros are there in c++?
Solution: There are two types of macros. They are object-like and function-like.
Q: What is the mandatory preprocessor directive for c++?
Solution: For a c++ program to execute, we need #include.
Q: What is the other name of the macro?
Solution: When the compiler encounters a previously defined macro, it will take the result from that execution itself.
Q: What will be the output of the following C++ code? #includeusing namespace std; #define PR(id) cout << "The value of " #id " is "<
Solution: In this program, we are just printing the declared values. Output: $ g++ mac.cpp $ a.out 10
Q: What will be the output of the following C++ code? #includeusing namespace std; #define MAX 10 int main() { int num; num = ++MAX; cout << num; return 0; }
Solution: Macro Preprocessor only replaces occurance of macro symbol with macro symbol value, So we can’t increment the value.
You Have Score    | /10 |