Programming MCQS - QUESTION DETAILS

How do you declare a dynamic array in C?
A. int arr[];
B. int arr[10];
C. int *arr = malloc(10 * sizeof(int));
D. int arr[10] = new int[10];

'malloc' is used to allocate memory for a dynamic array in C.

Similar Questions

What is the purpose of the 'do-while' loop in C?






What is the output of printf("%d", ~5);?






What is the output of printf("%f", 10 / 3);?






What is the purpose of the 'malloc' function in C?






What is the purpose of the 'union' keyword in C?






What is the output of printf("%c", 65);?






Which function is used to compare two strings in C?






How do you declare a constant pointer in C?






What is the purpose of the 'volatile' keyword in C?






What is the purpose of the 'rand' function in C?