[c언어 포인터] 3중 포인터 매개변수 질문이요!
조회수 437회
//int test(char*** token_list) {
char temp[3] = { "apple","bee","carrot" };
//만들어진 temp를 token_list에 넣기
}
어떻게 해야지 temp가 온전하게 token_list에 들어가나요?
-
(•́ ✖ •̀)
알 수 없는 사용자 - 〉
1 답변
-
정확하게 질문이 뭔지는 모르겠는데요. 대충 만든 예제 하나 던집니다.
#include <string.h> void fill_string(char buf[3][100]) { char default_string[3][100] = { "apple", "bee", "carrot" }; int i = 0; for(i = 0; i < 3; i++) { strcpy(buf[i], default_string[i]); } } int main() { char s[3][100] = {0,}; int i; fill_string(s); for(i = 0; i < 3; i++) { printf("%s\n", s[i]); } return 0; }
댓글 입력