References
- What is the output of this program?
#include <iostream>
using namespace std;
int main()
{
int num = 6;
int* ptr = #
cout << sizeof(ptr);
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
The size of a data type mainly depends on compiler only.
- What is the output of this program?
#include <iostream>
using namespace std;
int main()
{
double array[] = {3.0, 5.0, 6.0, 4.0};
double *p = (array + 3);
cout << *p << endl;
cout << array << endl;
cout << *(array + 2) << endl;
cout << *(array) << endl;
cout << *array + 6 << endl;
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
In this program, We are printing the values that are pointed by pointer and also the dereference operator.
- What does the dereference operator will return?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
It operates on a pointer variable, and returns an l-value equivalent to the value at the pointer address.