C Pointer to Pointer, Pointer to Functions, Array of Pointers Explained with Examples

C Pointer to Pointer, Pointer to Functions, Array of Pointers Explained with Examples

瀏覽:492
日期:2024-04-25
int rows = 2, col = 45; ptr = (char **)malloc(sizeof (char) * rows); int i; for (i = 0; i < rows; i++) {ptr[i] = (char *)malloc(col* sizeof (char));} for (i = 0; i < rows; i++) {printf("Address of row-%d is %p\n", i, ptr+i);} for (i = 0; i < rows; i++...看更多