我代码是这样的: #include <iostream> using namespace std; int result(int, int); const int k = 2; struct Point{ int x , y; }; int main() { int z(0), b(50); Point a; cout << "输入两个整数(以空格区分):"; cin >> a.x >> a.y; z = (a.x + a.y) * k; z = result(z, b); cout << "计算结果如下:" << endl; cout << "((" << a.x << " + " << a.y << " ) * " << k << ")+" << b << "=" << z << endl; return 0; } 但是报错了:
Scanning dependencies of target cpp
[ 50%] Building CXX object CMakeFiles/cpp.dir/main.cpp.o
[100%] Linking CXX executable cpp
Undefined symbols for architecture x86_64:
"result(int, int)", referenced from:
_main in main.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[3]: *** [cpp] Error 1
make[2]: *** [CMakeFiles/cpp.dir/all] Error 2
make[1]: *** [CMakeFiles/cpp.dir/rule] Error 2
make: *** [cpp] Error 2
DIEA
求大神帮忙,vim能编写c#程序吗
请问一下为什么它说foreach($data as $key=>$val)参数有问题呢,新手学习,请帮帮忙,谢谢
4-1最后一道编程题求大神找错误,我是新手
这节的习题答案没有看懂呢,求大神帮忙解答下
相关分类