Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
83 views2 pages

A) Compile-Time: Class:03 Polling Questions Functions and Operator Overloading

The document contains 5 multiple choice polling questions about C++ concepts including inline functions, function overloading, and operator overloading. The questions ask about the expansion of inline functions, function call resolution, which operators can be overloaded, and requirements for operator overloading functions.

Uploaded by

narendranvel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views2 pages

A) Compile-Time: Class:03 Polling Questions Functions and Operator Overloading

The document contains 5 multiple choice polling questions about C++ concepts including inline functions, function overloading, and operator overloading. The questions ask about the expansion of inline functions, function call resolution, which operators can be overloaded, and requirements for operator overloading functions.

Uploaded by

narendranvel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Class:03 Polling Questions

Functions and Operator Overloading

1) An inline function is expanded during ______________


a) compile-time
b) run-time
c) never expanded
d) end of the program
2) What will be the output of the following C++ code?

#include<iostream>
using namespace std;
int fun(int x = 0, int y = 0, int z)
{
return (x + y + z);
}
int main()
{
cout << fun(10);
return 0;
}

a) 10

b) 0

c) Error

d) Segmentation fault

3) What will be the output of the following C++ code?

#include <iostream>
using namespace std;
int fun(int=0, int = 0);
int main()
{
cout << fun(5);
return 0;
}
int fun(int x, int y)
{
return (x+y);
}
a) -5

b) 0

c) 10

d) 5

4) Which of the following operators cannot be overloaded?

a) Member access operator or Dot Operator

b) Scope resolution operator

c) Pointer to member operator

d) All the above

5) In case of operator overloading, operator function must be ______ .

1. Static member functions


2. Non- static member functions
3. Friend Functions

a. Only 2
b. Only 1, 3
c. Only 2 , 3
d. All 1 , 2, 3

You might also like