How to dynamically allocate a 2D array in C?
I know how to allocate 2D array but dynamically allocation is not clear. Would be thankful if someone will answer.
- 4237 Views
- 1 Answers
1 Answers
-
-
- 02 Apr
- 0 Comment
-
- Why C language is introduced? Explain your answer
- What does a person require to opt C programming as a career?
- Write a program to store 5 elements in the array P and 3 elements in the array Q.Produce a third array R after joining the array P and Q.Display the resultant array.
- Left Shift and Right Shift Operators in C
- Who invented C C++ and Java? Explain your answer
- Should I learn C before C++? Explain your answer
- What is the difference between return 0 and return 1?
- How will you print numbers from 1 to 100 without using loop?
- What is C programing? Explain your answer
- What is the eligibility criteria for cracking the C Progamming Exam 2018?
Practice Mock Test
c programming
Following are different ways to create a 2D array on heap (or dynamically allocate a 2D array).br /In the following examples, we have considered ‘r‘ as number of rows, ‘c‘ as number of columns and we created a 2D array with r = 3, c = 4 and following valuesbr /br / 1 2 3 4br / 5 6 7 8br / 9 10 11 12