C ++:下面显示的代码和功能声明和定义中同时省略关键字struct
的区别是什么 - 代码似乎在两种方式都相同?
#include <iostream>
#include <string>
struct student{
int age;
int number;
};
void printme( struct student m[]); // if 'struct' is omitted the code works as fine
int main()
{
student s[3];
s[0].age = 10;
s[0].number = 333;
printme(s);
return 0;
}
void printme( struct student m[]){
printf("George age and number: %d, %d \n", m[0].age, m[0].number);
}