typedef struct _name name;
struct _name { char name[256]; };
// ...
name Name;
char *buf = (char*)malloc( 256*sizeof(char) );
// ...
// if I do not want to write strcpy (Name.name,buf);
// and write: list_name_insert (&List,0,&Name);
// if just write:
list_name_insert (&List,0 /* index */,(name*)buf /* pointer to elem */);
// Will it be correct?
// ...
在函数 list_name_insert 标准 C 逐字段元素复制中执行。换句话说,srtuct { char[]; }
在char*
ANSI C 中是否相同?