#include <iostream>
usingnamespace std;
// Passing variables by "reference" the C way.
void getd(int *width, int *height) {
cout << "Enter width and height: ";
cin >> *width >> *height;
}
// How it's done in C++.
void getd2(int &width, int &height) {
cout << "Enter width and height: ";
cin >> width >> height;
}
int main() {
int w = 0, h = 0, area = -1;
// How it's called in the C-style pointer version (need to pass addresses).
getd(&w, &h);
area = w * h;
cout << area << '\n';
// How it's called in C++ reference version.
getd2(w, h);
area = w * h;
cout << area << '\n';
return 0;
}