Created
June 5, 2015 17:35
-
-
Save toanalien/df0b857d0f4eba33b372 to your computer and use it in GitHub Desktop.
pointer point to pointer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
#define ROWS 4 | |
#define COLS 5 | |
int main() | |
{ | |
int table_i[ROWS][COLS] = { | |
{10,12,14,16,18}, | |
{11,13,15,17,19}, | |
{20,22,24,26,28}, | |
{21,23,25,27,29} | |
}; | |
int i, ij, ix = 10; | |
for (i = 0; i < ROWS; i++) | |
for (ij = 0; ij < COLS; ij++) | |
*(*(table_i + i) + ij) += ix; | |
for (i = 0; i < ROWS; i++) | |
{ | |
for (ij = 0; ij < COLS; ij++) | |
printf("%4d", *(*(table_i + i) + ij)); | |
printf("\n"); | |
} | |
getch(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment