#include <iostream>
using namespace std;
int myFunc (unsigned short int x);
int main()
{
unsigned short int x, y;
x=7;
y = myFunc(x);
std::cout << "x:" << x << "y: " << y << "\n";
return 0;
}
int myFunc (unsigned short int x)
{
return (4 * x);
}
弄得现在这^代码的工作,但是当我改变C++:在一些有关职能
y = myFunc(x);
到
y = myFunc(int);
将不再工作,这是为什么?
它为什么会工作?你期望它做什么? – Andrei 2011-06-13 09:07:19