Video giải thích chi tiết về Kiểu dữ liệu struct lồng nhau trong lập trình C | Tự học lập trình C
Code ví dụ
#include "stdio.h"
struct point{
float x;
float y;
}
struct triangle{
point a, b, c;
};
struct circle{
point c;
float r;
};
struct rectangle{
point a, b, c, d;
};
struct polygon{
point[100] ps;
int n;
};
struct polygon2{
point* ps;
};
struct date{
int day;
int month;
int year;
};
struct person{
char[100] name;
date dateOfBirth;
float weight;
};
struct person{
char[100] name;
struct date{
int day;
int month;
int year;
} dateOfBirth;
float weight;
};
Không có nhận xét nào:
Đăng nhận xét