基于Visual Studio 2015 将下面两个cpp文件置于同一源文件目录下即可 源.cpp #include stdio.h int main() { extern int sum(int x, int y); int x, y; printf("please enter two nums:"); scanf("%d%d", x, y); printf("sum:%d\n", su
基于Visual Studio 2015
将下面两个cpp文件置于同一源文件目录下即可
源.cpp
int main()
{
extern int sum(int x, int y);
int x, y;
printf("please enter two nums:");
scanf("%d%d", &x, &y);
printf("sum:%d\n", sum(x, y));
return 0;
}
add.cpp
{
return x + y;
}
运行结果如下: