c 언어 유연성 배열

453 단어 C
http://www.2cto.com/kf/201404/293519.html
#include "stdio.h"

struct st_type
{
    int i;
	int a[];
};
void main(void)
{
	struct st_type *st_p =(struct st_type *)malloc(sizeof(struct st_type)+100*sizeof(int));
	st_p->i=10;
	memcpy(st_p->a,"i love you!!!!!!",20);
	printf("%d %s\r
",st_p->i,st_p->a); }

10 i love you!!!!!!
Press any key to continue

좋은 웹페이지 즐겨찾기