Will the inline function be compiled as the inline function always? Justify.
Answer / atul shankhwar
An inline function is a request and not a command. Hence it won't be compiled as an inline function always.
Explanation:
Inline-expansion could fail if the inline function contains loops, the address of an inline function is used, or an inline function is called in a complex expression. The rules for inlining are compiler dependent.
| Is This Answer Correct ? | 1 Yes | 1 No |
Is python better than c++?
How can you create a virtual copy constructor?
What is an operator function? Describe the function of an operator function?
What are the general quetions are in DEna bank manager IT/System interviews?
Why pure virtual functions are used if they don't have implementation / When does a pure virtual function become useful?
What is a built-in function?
What is a driver program?
Find out the bug in this code,because of that this code will not compile....... #include <iostream> #include <new> #include <cstring> using namespace std; class balance { double cur_bal; char name[80]; public: balance(double n, char *s) { cur_bal = n; strcpy(name, s); } ~balance() { cout << "Destructing "; cout << name << "\n"; } void set(double n, char *s) { cur_bal = n; strcpy(name, s); } void get_bal(double &n, char *s) { n = cur_bal; strcpy(s, name); } }; int main() { balance *p; char s[80]; double n; int i; try { p = new balance [3]; // allocate entire array } catch (bad_alloc xa) { cout << "Allocation Failure\n"; return 1; }
Which of the following is not a valid declaration for main() a) int main() b) int main(int argc, char *argv[]) c) They both work
What is function prototyping?
Explain how an exception handler is defined and invoked in a Program.
How would you differentiate between a pre and post increment operators while overloading?