Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <locale.h>
- int M = 0, // Строки
- N = 0; // Столбцы
- //int arr[M][N];
- int *pA;
- ////////////////////////////////////////////////////////////
- int main() //
- {
- setlocale(LC_ALL, "rus");
- printf("Введите кол-во строк M и столбцов N: "); scanf("%d%d", &M, &N); printf("\n");
- printf("M = %d, N = %d\n", M, N);
- int *a = (int*)malloc(M * N * 4);
- for(int i = 0; i < M*N; i++)
- {
- printf("%d\n", a[i]);
- }
- free(a);
- }
- /*
- #include <stdio.h>
- #define SONY 77
- int a = 1;
- int *pA;
- ////////////////////////////////////////////////////////////
- int main() //
- {
- int p[15]; // 123 * 4
- pA = p;
- printf("%d\n", p );
- printf("%d\n", pA);
- printf(" - - - - - - - - - \n");
- for(int i = 0; i < 10; i++)
- {
- printf("%10d - - - %10d\n", pA[i], p[i]);
- }
- }
- */
- /*
- #include <stdio.h>
- #define SONY 77
- int a = 1;
- int p[123]; // 123 * 4
- int *pA;
- ////////////////////////////////////////////////////////////
- int main() //
- {
- pA = p;
- printf("%d\n", p );
- printf("%d\n", pA);
- printf(" - - - - - - - - - \n");
- for(int i = 0; i < 10; i++)
- {
- printf("%d\n", pA[i] );
- }
- }
- */
Advertisement
Comments
-
- I wanted to drop you a note to say thank you for enlightening me about Pastebin. It has proven to be an invaluable tool for organizing and sharing data. Your thoughtfulness in sharing this resource is truly appreciated!
Add Comment
Please, Sign In to add comment
Advertisement