[c언어]Dynamic memory를 c program으로 구현
- 최초 등록일
- 2005.12.16
- 최종 저작일
- 2005.08
- 2페이지/ 텍스트
- 가격 1,000원
소개글
제목 그대로 Dynamic memory를 c program으로 구현해 낸것입니다.
목차
없음
본문내용
/*
************************************************************************
Program to illustrate use of various dynamic memory
management functions
************************************************************************
*/
#include <stdio.h>
#include <conio.h>
#include <process.h>
#include <stdlib.h>
#include <alloc.h>
#include <string.h>
void main()
{
char *str1, *str2, *str3;
clrscr();
printf("ntProgram Is For Dynamic Memory Management Operationsnn");
str1 = (char *) malloc(30);
if ( str1 == NULL )
{
printf("Insufficient memoryn");
getch();
exit(1);
}
strcpy(str1, "This is the string1 allocated using malloc");
printf("%sn", str1);
str2 = (char *) calloc(30, sizeof(char) );
if ( str2 == NULL )
{
printf("Insufficient memoryn");
getch();
exit(1);
참고 자료
없음