- 论坛徽章:
- 0
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef signed char byte;
typedef unsigned char ubyte;
typedef struct bgOneDimension
{
short len;
byte* data;
}BGOneDimension;
typedef BGOneDimension* bgOneDimension;
typedef struct bgTwoDimension
{
short len2;
bgOneDimension* oneDim;
}BGTwoDimension;
typedef BGTwoDimension* bgTwoDimension;
typedef struct bgThreeDimension
{
short len3;
bgTwoDimension* twoDim;
}BGThreeDimension;
typedef BGThreeDimension* bgThreeDimension;
typedef struct ggOneDimension
{
short len;
byte* data;
}GGOneDimension;
typedef GGOneDimension* ggOneDimension;
typedef struct ggTwoDimension
{
short len2;
short* len;
byte** data;
}GGTwoDimension;
typedef GGTwoDimension* ggTwoDimension;
typedef struct ggThreeDimension
{
short len3;
short* len2;
short** len;
byte*** data;
}GGThreeDimension;
typedef GGThreeDimension* ggThreeDimension;
当时和朋友讨论这两个声明哪个好一点, 我朋友也说第一个好, 当时他也说定义一个变量 中转下,
结构也清晰的。
看来我的 水平太差, 以至于这么的没有品味, 这个问题我纠结了好长时间了, 看来要写好面向对像, 必需能够接受 结构体嵌套。 |
|