小编Cod*_*r95的帖子

如何在C ++中使用指针创建输入法

我想创建一个使用指针创建两个整数的输入法。如果您可以帮助我或给我任何提示,那就太好了。:)

我的方法:

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)

c++ methods pointers input cin

5
推荐指数
1
解决办法
110
查看次数

标签 统计

c++ ×1

cin ×1

input ×1

methods ×1

pointers ×1