Skip to content

Instantly share code, notes, and snippets.

@surinoel
Last active July 16, 2019 09:53
Show Gist options
  • Save surinoel/635c8612e00fae7d62456f3856b746c0 to your computer and use it in GitHub Desktop.
Save surinoel/635c8612e00fae7d62456f3856b746c0 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(void) {
int numArr[3][4] = {
{ 11, 22, 33, 44 },
{ 55, 66, 77, 88 },
{ 99, 110, 121, 132 }
};
// int** numPtr = numArr; // 강제 캐스팅 (int**)하면 실행은 되지만, 결국 -값을 리턴하면서 끝난다
int (*numPtr)[4] = numArr; // 만일 괄호를 빼먹은다면, 배열 포인터가즉 int *numPtr[4]는 포인터 배열을 의미한다
printf("%d\n", numPtr[0][0]);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment