Question

Explain how will you allocate memory dynamically for a two dimensional array of floating point numbers.

18 Feb 2025
Answer :
Word Count : 282

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
Skip in 10
Top
📞
Call Support Instant phone assistance IGNOU MMT 1 2025 - Explain how will you allocate memory dynamically for a two dimensional | IGNOU Academy
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→