-
What is the output of this program?
#include
using namespace std;
int main()
{
int num = 10;
void *ptr = #
int *ptr0 = static_cast(ptr);
cout << *ptr0;
return 0;
}
-
- 10
- Compilation Error
- Runtime Error
- Garbage value
- None of these
Correct Option: A
We just casted this from void to int, so it prints 10.