65,210
社区成员
发帖
与我相关
我的任务
分享typedef struct student
{int age,sex;
char* name;
}Stu;
typedef struct
{int age,sex;
char* name;
}Stu;
我想问一下大家,上面的两种写法的含义,作用是否一样,Stu是不是可以当做这个结构体的别名typedef struct Node
{
KeyType data;
struct Node * lchild;
struct Node * rchild;
} * BiTree ,BiTnode;
#include <iostream>
using namespace std;
typedef struct
{int age,sex;
char* name;
}Stu;
int main()
{
Stu s;
s.age=16;
s.sex=1;
strcpy(s.name,"hello");
cout<<s.name<<" "<<s.age<<" "<<s.sex<<endl;
return 0;
}