C语言基础 -51 构造类型_结构体的定义变量及成员引用

C语言基础 -51 构造类型_结构体的定义变量及成员引用_第1张图片

book@100ask:~/C_coding/CH02$ cat strct.c
#include 
#include 

#define NAMESIZE 32

struct simp_st
{
	int i;
	float f;
	char ch;
};

int main()
{
// TYPE NAME = VALUE;

	struct simp_st a = {123,456.789,'a'};
	a.i = 112233;
	printf("%d %f %c\n",a.i,a.f,a.ch);
	exit(0);
}


book@100ask:~/C_coding/CH02$ make strct
cc     strct.c   -o strct


book@100ask:~/C_coding/CH02$ ./strct
112233 456.789001 a
book@100ask:~/C_coding/CH02$ cat struct.c
#include 
#include 

#define NAMESIZE 32

struct simp_st
{
	int i;
	float f;
	char ch;
};

struct birthday_st
{
	int 

你可能感兴趣的:(Linux,C编程)