Which of the following operators cannot be overloaded in C++?
The two's complement of a negative number is obtained by adding 1 to its 1's complement.
#include
What is used to iterate over a container?
What error is generated when placing an address operator with a variable in a printf() statement?
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
int a = 5, b = 10, c = 15;
int *arr[ ] = {&a, &b, &c};
cout << arr[1];
return 0;
}
What will happen if the following C code is executed?
What is the output of the following program?
int main()
{
int i,j;
int x[5][2]={{1,2},{3,4},{5,6},{7,8},{9,10}};
for(int i=0;i<5;i++)
{
printf("\n");
for(int j=0;j<2;j++)
{
printf("%d",*(*(x+i)+j));
if(j==0)
printf(",");
}
}
}
Why are constructors more efficient than a user-defined init() function for initializing object data members?