Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void Vvod(double*** arr, int Dim1, int Dim2);
- int main() {
- double** a;
- int n = 3, m = 3;
- Vvod(&a, n, m);
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < m; j++) a[i][j] = 3.14 + 2.0 * i;
- }
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < m; j++) printf("%1.9f ", a[i][j]);
- printf("\n");
- }
- for (int i = 0; i < n; i++) free(a[i]);
- free(a);
- return 0;
- }
- void Vvod(double*** arr, int Dim1, int Dim2) {
- *arr = (double**)calloc(Dim1, sizeof(double*));
- for (int i = 0; i < Dim1; i++) (*arr)[i] = (double*)calloc(Dim2, sizeof(double));
- }
- //кто прочитал тот лох
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement