Desc :

 

 


Source Code :

#include <stdio.h>
#include <string.h>
#include <malloc.h>

void main()
{
	char *pbuf;

	pbuf = malloc(100 * 10000);

	if (pbuf)
	{
		memset(pbuf, 0, 100 * 1000);	// 할당된 메모리 버퍼를 null로 채움
		strcpy(&pbuf[0], "string");
		puts(&pbuf[0]); // 0위치부터 문자열 출력
		free(pbuf);
	}
}

 


Result :

 

+ Recent posts