我试图将一个int值传递给一个函数,该函数向用户返回一个char值。将char值和int值传递到一个函数
像这样的事情
// this is the function call
option = function1(cus_num)
char function1 (int num1){
char test
// displays options for user to input char
cout << "Customer #" << num1 << "plese enter an option";
cin >> test;
return test;
但每次我这样做的时候,该NUM1显示为#0x47e7484替代的价值。我知道该函数设置为返回一个字符,但我不能传递一个int给它吗?
请示出了[完整最小示例](https://stackoverflow.com/help/mcve)。 – 5gon12eder 2014-10-04 21:33:46
“test”(第一次)后面缺少';'。 – 2014-10-04 21:50:36