The address of a variable can be directly accessed by Ampersand.Then why do we use pointers. Isn't that useless?
I have used ampersand and pointer and obtained the same output.
#include <iostream>
using namespace std;
int main()
{
int score = 5;
int *scorePtr;
scorePtr = &score;
cout << scorePtr << endl;
cout << &score << endl;
//output
//0x23fe44
//0x23fe44
return 0;
}