a) int *arr = malloc(r * c * sizeof(int));
b) int *arr = (int *)malloc(r * c * sizeof(int));
c) int *arr = (int *)malloc(r + c * sizeof(int));
d) int *arr = (int *)malloc(r * c * sizeof(arr));
How do you allocate a matrix using a single pointer in C?(r and c are the number of rows and columns respectively)
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
How do you allocate a matrix using a single pointer in C?(r and c are the number of rows and columns respectively)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!