Consider the code snippet below. int ch = 100; Which of the following is a legally correct way of obtaining the memory location of ch and printing it (the memory location) to standard output, based on the given code snippet?

Consider the code snippet below.
int ch = 100;
Which of the following is a legally correct way of obtaining the memory location of ch and printing it (the memory location) to standard output, based on the given code snippet?


A) cout << ch << endl;
B) cout << *ch << endl;
C) cout << &ch << endl;
D) cout << *(&ch) << endl;

Ans: C
Title: Which statement gets the memory location of ch and prints it to standard output?
Difficulty: Easy


Learn More Multiple Choice Question :