Global
Guideline
Interviewer and Interviewee Guide
Home
Interview Questions
Online Quiz Tests
Blog
Contact Us
Close Menu
Copyright © 2005 - 2024. All Rights Reserved
Search
Home
Interviews
C++ Language
C++ Operator Overloading
C++ Operator Overloading Question:
How many parameters does a conversion operator may take?
a) 0
b) 1
c) 2
d) as many as possible
Tweet
Share
WhatsApp
Download C++ Operator Overloading PDF
Answer:
a) 0
Download C++ Operator Overloading PDF
Read All 26 C++ Operator Overloading Questions
Previous Question
Next Question
Why we use the "dynamic_cast" type conversion?
a) result of the type conversion is a valid
b) to be used in low memory
c) result of the type conversion is a invalid
d) None of the mentioned
What is the output of this program?
#include <iostream>
using namespace std;
class sample1
{
float i, j;
};
class sample2
{
int x, y;
public:
sample2 (int a, int b)
{
x = a;
y = b;
}
int result()
{
return x + y;
}
};
int main ()
{
sample1 d;
sample2 * padd;
padd = (sample2*) &d;
cout < result();
return 0;
}
a) 20
b) runtime error
c) random number
d) c or b