---
title: "结构体"
author: "includemain"
date: "2012-05-07T00:00:26Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2012-05-07T00:01:17Z"
id: 1513387
url: "https://indiff.iteye.com/blog/1513387"
---

```c
#include <stdio.h>

struct Person {
	char i;
	char a[7];
	int no;
	int age;
};

struct Country {
	char i;
	int j;
	char k[7];
	int a;
};
void main() {

	struct Person p = {
		'a', "abcdef", 1, 20
	};
	
	struct Country c = {
		'a', 1, "abcdef", 20
	};
	printf("Person结构体占用的大小:%d\n", sizeof( struct Person ) );
	printf("Country结构体占用的大小:%d\n", sizeof( struct Country ) );
}

```



```java
Person结构体占用的大小:16
Country结构体占用的大小:20
```