Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Take Free Test
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Take Free Test
References Questions
C++ lvalue references cannot bind to rvalues: detect the error with post-increment operands. #include
int main() { int m = 2, n = 6; int &x = m++; int &y = n++; m = x++; x = m++; n = y++; y = n++; cout << m << " " << n; return 0; }
C++ constructor parameters assigned via this-> and no Display call: what prints? #include
class Tab { int x, y; public: Tab(int x, int y) { this->x = x; this->y = y; } void Display() { cout << x << " " << y; } }; int main() { int x = 50; int &y = x; Tab b(y, x); // no call to Display() return 0; }
In C++ programming, consider the following two statements about references: A reference is not a constant pointer, but rather an alias for an existing object. A reference is automatically dereferenced when it is used in an expression, so you access the referred value without using the * operator. Which one of the following options correctly describes these two statements?
1
2
3