标签:size std ide printf img cli hide for com
#include <stdio.h> int main() { int array[4][5] = {0}; printf("sizeof int: %d\n", sizeof(int)); printf("array: %p\n", array); printf("array + 1: %p\n", array + 1); return 0; }
#include <stdio.h> int main() { int array[4][5] = {0}; int i, j, k = 0; for (i = 0; i < 4; i++) { for (j = 0; j < 5; j++) { array[i][j] = k++; } } printf("*(array+1): %p\n", *(array + 1)); printf("array[1]: %p\n", array[1]); printf("&array[1][0]: %p\n", &array[1][0]); printf("**(array+1): %d\n", **(array+1)); return 0; }
#include <stdio.h> int main() { int array[4][5] = {0}; int i, j, k = 0; for (i = 0; i < 4; i++) { for (j = 0; j < 5; j++) { array[i][j] = k++; } } printf("*(array+1): %p\n", *(array + 1)); printf("array[1]: %p\n", array[1]); printf("&array[1][0]: %p\n", &array[1][0]); printf("**(array+1): %d\n", **(array+1)); printf("*(*(array+1)+3): %d\n", *(*(array+1)+3)); printf("array[1][3]: %d\n", array[1][3]); return 0; }
#include <stdio.h> int main() { int array[2][3] = {{0, 1, 2}, {3, 4, 5}}; int (*p)[3] = array; printf("**(p+1): %d\n", **(p+1)); printf("**(array+1): %d\n", **(array+1)); printf("array[1][0]: %d\n", array[1][0]); printf("*(*(p+1)+2): %d\n", *(*(p+1)+2)); printf("*(*(array+1)+2): %d\n", *(*(array+1)+2)); printf("array[1][2]: %d\n", array[1][2]); return 0; }
标签:size std ide printf img cli hide for com
原文地址:https://www.cnblogs.com/helloworld2019/p/11104539.html