Skip to content

Instantly share code, notes, and snippets.

@toanalien
Created June 5, 2015 17:35
Show Gist options
  • Save toanalien/df0b857d0f4eba33b372 to your computer and use it in GitHub Desktop.
Save toanalien/df0b857d0f4eba33b372 to your computer and use it in GitHub Desktop.
pointer point to pointer
#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