With a variable (char) named xy
, output the contents of this variable to the console without using the variable directly, or it's memory address, using 2 other variables named x
. You must use the following 2 lines of code below, and these variables cannot be modified in any way:
const int x = 0, y = 0;
const char xy = "AceInfinity";
Find what would go in place of the ???
in order to output the value of xy
to the console:
std::cout << ??? << std::endl;
You can create a function or do whatever you like as long as you don't modify the variables x, y, or xy, and you don't use the xy variable at all to output it's contents directly. This includes taking a pointer to a significant memory address that would help you read the contents of that variable. In other words, you shouldn't have xy referenced anywhere else in your code, other than where it was declared (from the second line of the 2 required lines of code above).
I will reveal the solution in a while if nobody gets this.