1
동적으로 할당 된 배열이 char**
인데 하나의 정적 배열에 추가하는 방법은 무엇입니까? 배열을 char***
사용해야합니까?3 개의 동적 Char ** 배열을 하나의 정적 배열에 추가합니다. (C)
void memory_allocation (char ***array [3], int* limit)
{
int i; //loop control
for (i = 0; i < 3; i++)
{
array [i] = (char***) malloc (*limit * sizeof(char*));
if (array [i] == NULL) //must take malloc's failure to allocate memory into account
printf ("Memory allocation failed!\n");
exit (1);
}
}
어떤 언어? 질문에 적절하게 태그를 답니다. 대답은 D, Go, C# 및 녹과 다릅니다. –
당신은 당신의 노력을 보여줄 수 있습니까? – tod
시도해보고 작동하는지 확인하십시오. – armanali