静态全局变量得初始化

                                                                        静态全局变量得初始化0;        

#include "common.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define PI     (3.141592)
static float test_equation = 0;
static char  letter_A = '\r';

struct gammon_class
{
	int rou;
	int yumi;
	int mian_feng;
	int fangfuji;
	int zhiliang;
	int length;
	int annotate[50];
	struct gammon_class * pNext;
};

static struct gammon_class  one_gammon;

int main()
{	
	int i = 0;
	while (1)
	{
		printf("多少根肉 %d\n", one_gammon.rou);
		printf("多少玉米 %d\n", one_gammon.yumi);
		printf("火腿多长 %d\n", one_gammon.length);
		printf("火腿得pNode %p\n", one_gammon.pNext);
		//for (i = 0; i < 50; i++)
		{
			printf("打印初始化注释%d\n", one_gammon.annotate[i]);
		}
		getchar();
	}

	return 0;
} 

  

     

                                                                    

一勤天下无难事。
原文地址:https://www.cnblogs.com/nowroot/p/12391735.html