I would like to know:
- how to point the elements of a table to an array of elements?
- How to make the operations on?
Here is a code that I wrote:
#include <stdio.h>
#include <stdlib.h>
#define N 4
int main(int argc, char const *argv[]) {
int i;
int *t[N];
int tab1[N] = {1, 2, 3, 4},
tab2[N] = {5, 6, 7, 8},
tab3[N] = {9, 10,11, 12},
tab4[N] = {13, 14, 15, 16};
for (i = 0 ; i < N; i++) {
*t[i] = tab1[i];
}
for (i = 0; i < N; i++) {
printf("%d\n", *t[0]);
}
}
When I run it, nothing is happening.
fogang@les-tatates:~/tp_304$ gcc -o test test.c
fogang@les-tatates:~/tp_304$ test
fogang@les-tatates:~/tp_304$