#include <iostream>
bool test(int a, int &b) {
b = a + 5;
return true;
}
int main()
{
int e = 20;
int c = 15;
test(e, c);
std::cout << "c: " << c << std::endl;
return 0;
}
b作为形参传入的同时也被当做了输出。
#include <iostream>
bool test(int a, int &b) {
b = a + 5;
return true;
}
int main()
{
int e = 20;
int c = 15;
test(e, c);
std::cout << "c: " << c << std::endl;
return 0;
}
b作为形参传入的同时也被当做了输出。