代码:
#include
#include
#include
#include "testcpp.cpp"
int main()
{
aaa t;
t.ChangeK(&t);
t.PutK(&t);
system("pause");
return 0;
}
testcpp.cpp
#include
using namespace std;
typedef struct aaa{
int k = 0;
void ChangeK(aaa *b);
void PutK(aaa *b);
}aaa;
void aaa::ChangeK(aaa *b){ int c = 0; cin >> c; b->k = c; }
void aaa::PutK(aaa *b){ cout << b->k; }
错误是我多次定义了这个ChangeK和PutK函数、、、、已在OBJ里存在了。。。