1. 程式人生 > >自定義結構體及初始化

自定義結構體及初始化

自定義結構體及初始化,以及標頭檔案先宣告巨集,然後宣告結構體

<pre name="code" class="cpp">/********************** macro definition **********************/
#ifndef CVALGO_PI
#define CVALGO_PI 3.141592653589793238462643383	
#endif

/********************** structure definition **********************/
/* pixel point information definition */
typedef struct POINT_s {
	POINT_s() {
		dx = 0.0;
		dy = 0.0;
		dz = 0.0;
	}
	double dx;		/* Specifies the x-coordinate of point */
	double dy;		/* Specifies the y-coordinate of point */
	double dz;		/* Specifies the z-coordinate of point */	
}POINT_t;