Question
Explain how will you allocate memory dynamically for a two dimensional array of floating point numbers.
Answer :
Word Count : 282
______ _______ ________ ____ ____ ________.
____ ________ ______ ____ ________ ____ _________.
______ ____ _______ _________ ____ ____ ____ ________ _________ ____ _________ ________.
_____ ______ ___ ________ ________ _________ _______ _____ _______ _______ _____ ___.
____ __________ __________ __________ _____ ____ ______ ___ _____ __________ _________.
_______ ______ _____ ___ ______ __________ ______ __________ ________ __________.
______ ___ _____ _______ _______ ___ ______ __________ ____.
_________ ____ ________ ___ _____ ________ ____ ____ __________.
_______ ___ ___ _________ __________ ________ ___ ____ ______.
____ ______ ___ ___ _______ ______.
__________ __________ ________ ___ ______ ___ ______.
____ _____ ____ ______ ___ _____ _____ _____.
__________ ______ ________ _______ _____ _____ ________.
_________ _________ ______ __________ ____ _________ ______ ____ _______ ______.
____ ________ _______ ____ ______ ___ ______ _________ ___ ____ _______.
______ ___ ________ ______ ______ ___ __________ ____ _____ ________ _________ ______.
____ __________ ____ _________ __________ ________.
_______ _______ ____ ______ _______ ___.
________ __________ _____ ______ _____ _________ _________ ____ _________ _____.
________ ____ _______ ________ ________ ______ _____ _________ _____ ________ _____.
_______ ________ ______ ___ ____ ________ ____ ______ _____ _________ _________ ______.
__________ _________ _____ ____ _________.
__________ _________ _________ _____ _____ ________ _______.
Skip in 10
To allocate memory dynamically for a two-dimensional array of floating point numbers in C, we can use pointers and the `malloc()` function. The first step is to allocate memory for the array of pointers, where each pointer will represent a row. Then, for each row, we allocate memory to hold the elements (columns) of that row. Here's how this can be done:
1. Step 1: Allocate memory for the rows (array of pointers).
```c
float
____ ________ ______ ____ ________ ____ _________.
______ ____ _______ _________ ____ ____ ____ ________ _________ ____ _________ ________.
_____ ______ ___ ________ ________ _________ _______ _____ _______ _______ _____ ___.
____ __________ __________ __________ _____ ____ ______ ___ _____ __________ _________.
_______ ______ _____ ___ ______ __________ ______ __________ ________ __________.
______ ___ _____ _______ _______ ___ ______ __________ ____.
_________ ____ ________ ___ _____ ________ ____ ____ __________.
_______ ___ ___ _________ __________ ________ ___ ____ ______.
____ ______ ___ ___ _______ ______.
__________ __________ ________ ___ ______ ___ ______.
____ _____ ____ ______ ___ _____ _____ _____.
__________ ______ ________ _______ _____ _____ ________.
_________ _________ ______ __________ ____ _________ ______ ____ _______ ______.
____ ________ _______ ____ ______ ___ ______ _________ ___ ____ _______.
______ ___ ________ ______ ______ ___ __________ ____ _____ ________ _________ ______.
____ __________ ____ _________ __________ ________.
_______ _______ ____ ______ _______ ___.
________ __________ _____ ______ _____ _________ _________ ____ _________ _____.
________ ____ _______ ________ ________ ______ _____ _________ _____ ________ _____.
_______ ________ ______ ___ ____ ________ ____ ______ _____ _________ _________ ______.
__________ _________ _____ ____ _________.
__________ _________ _________ _____ _____ ________ _______.
IGNOU ACADEMY
Your IGNOU journey, made easier.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.