E D R , A S I H C RSS

새싹-날다람쥐 6월 10일


->


char *d;

d = (char*)malloc(sizeof(char)*100);

malloc(sizeof(char)*100);

메모리 (sizeof(char)*100)byte만 .

d는 char* Casting (char*)malloc(sizeof(char)*100); .
char d [100] .

char *d;

d = (char*)malloc(sizeof(char)*100);

d[10] .



ex) 2 만들면?

char **arrray, *d;


d = (char*)malloc(sizeof(char) * 100);

arrray = (char**)malloc(sizeof(d) * 100);

면 char array [100][100] .




냐?


int temp;

char *d;

scanf("d .\n%d", temp);

d = (char*)malloc(sizeof(char) * temp);



를 배 .
C는 변 int d[temp] .(무데 는 C++ 는 불.)

: 메모리 .



FREE

free(d); 를 는 sizeof(char) * temp만 메모리를 OS .

free는 . 따 array를 모 free면 for문 free(array[i]) free(array);를 .

. OS .

( )는 메모리 메모리 메모리를 메모리 .
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:41
Processing time 0.0124 sec