πŸ“Š C++
Q. What is the output of the following code snippet? int x = 10; int *ptr = &x; cout << *ptr;
  • (A) 10
  • (B) Address of x
  • (C) 0
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) 10

Explanation: The pointer 'ptr' points to x, and *ptr dereferences it to give the value of x, which is 10.

Explanation by: Gopal Sharma
The pointer 'ptr' points to x, and *ptr dereferences it to give the value of x, which is 10.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
201
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Gopal Sharma
Publisher
πŸ“ˆ
81%
Success Rate