我想创建一个使用指针创建两个整数的输入法。如果您可以帮助我或给我任何提示,那就太好了。:)
我的方法:
void inputTest(int* x, int* y) {
cin >> x;
cin >> y;
}
Run Code Online (Sandbox Code Playgroud)
我的主要:
int *x = 0;
int *y = 0;
cout << "Input: " << endl;
//set input from user x,y with input method
inputTest(x,y);
Run Code Online (Sandbox Code Playgroud)