本帖最后由 古月不傲 于 2021-1-30 15:16 编辑
[C++] 纯文本查看 复制代码 #include <iostream>
using namespace std;
struct student {
int score;
int age;
}*ssss;
static student* nana[4];
int neo(student* qqqq)
{
int i;
for (i = 0; i < 4; i++)
{
if (!nana[i])
{
cout << " nana[" << i << "] = " << nana[i] << endl;
nana[i] = qqqq;
cout << " nana[ " << i <<" ] =" <<nana[i]->score << endl;
cout << " nana[ " << i <<" ] ="<< nana[i]->age << endl;
qqqq++;
}
};
return 0;
};
int main()
{
student aa[4] = { {1,2},{3,4},{5,6},{7,8} };
neo(aa);
return 0;
}
return的含义都忘了吗? |