#include <iostream>
using std::cout;
using std::cin;
int main() {
int x;
cout << "Enter a number: ";
cin >> x;
cout << "\n" << "You entered: " << x;
}
Instead of this:
#include <iostream>
using std::cout;
using std::cin;
int main() {
int x;
int *p;
cout << "Enter a number: ";
cin >> x;
p = &x;
cout << "\n" << "You entered: " << *p;
}
I honestly don't get the point of pointers. I have searched several different tutorials on c++ but they don't really tell me what the point of them is.

New Topic/Question
Reply



MultiQuote









|