Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #define y 4
- #define x 4
- int suma_elementow_kolumny(int *wskaznik, int Y, int X, int kolumna)
- {
- int i = 0;
- int suma_kolumny = 0;
- for (i = 0; i < Y; i++)
- {
- suma_kolumny += *(*(wskaznik + i) + kolumna);
- }
- return suma_kolumny;
- }
- int main()
- {
- int kolumna = 0;
- int tab[y][x] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
- printf("Suma drugiej kolumny to: %d", suma_elementow_kolumny(&tab[0][0], y, x, kolumna));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement