接上个博客,发现结构体拥有的属性和数据库有点类似,就用结构体实现了学生信息的存储,上代码:
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include <stdlib.h>
typedef struct test{
int a;
char b;
char c;
}STU;
typedef struct student{
int num;
char name[20];
int age;
float score;
}DATA;
void test01() {
STU stu = {
0 };
printf("长度: %d\n", sizeof(stu));//8个字节
printf("stu=%p\n"