Nguyễn Trọng Tân
New member
What will be the output of the following C++ code?
A. 15
B. 18
C. garbage value
D. compile time error
Code:
#include <stdio.h>
#include<iostream>
using namespace std;
int main()
{
int a = 5, b = 10, c = 15;
int arr[3] = {&a, &b, &c};
cout << *arr[*arr[1] - 8];
return 0;
}
B. 18
C. garbage value
D. compile time error