Which statement(s) create a dynamically allocated 2D array of integers with size a total size of 100 and consists of 5 rows (20 elements each)? int** ptr (int**) malloc (5, sizeof(int*)}; for(int i = 0; i <5;+) ptr[i] = (int*) calloc (20, sizeof(int)): int** ptr (int**) malloc (5, sizeof(int*)); for(int i- 0; i<5;i+) ptr[i] = (int*) malloc (20*sizeof(int): int* ptr (int*) malloc (5, sizeof(int); for(int i 0; i<5; i++) ptri) - (int*) malloc (20, sizeof(int)): int ptr (int*) malloc (5, sizeof(int)): for(int i- 0: i<5; i++) ptrli)= (int) calloc (20, sizeof(int)):

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 9RQ
icon
Related questions
Question
Which statement(s) create a dynamically allocated 2D array of integers with size a total size of 100 and consists of 5 rows (20
elements each)?
A int**
ptr = (int**) malloc (5, sizeoftint*); for(int i = 0; i < 5; i++) ptrli) = (int*) calloc (20, sizeof(int);
int**
ptr = (int**) malloc (5, sizeof(int*); for(int i = 0; i < 5 ; i++) ptrfi) - (int") malloc (20*sizeof(int):
B.
int* ptr = (int*) malloc (5, sizeof(int)): for(int i 0; i<5; i++) ptr[i) = (int*) malloc (20, sizeof(int):
int* ptr = (int*) malloc (5, sizeof(int): for(int i- 0; i<5; i++) ptrli) - (int) calloc (20. sizeof(int)):
Transcribed Image Text:Which statement(s) create a dynamically allocated 2D array of integers with size a total size of 100 and consists of 5 rows (20 elements each)? A int** ptr = (int**) malloc (5, sizeoftint*); for(int i = 0; i < 5; i++) ptrli) = (int*) calloc (20, sizeof(int); int** ptr = (int**) malloc (5, sizeof(int*); for(int i = 0; i < 5 ; i++) ptrfi) - (int") malloc (20*sizeof(int): B. int* ptr = (int*) malloc (5, sizeof(int)): for(int i 0; i<5; i++) ptr[i) = (int*) malloc (20, sizeof(int): int* ptr = (int*) malloc (5, sizeof(int): for(int i- 0; i<5; i++) ptrli) - (int) calloc (20. sizeof(int)):
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage