+1 vote
in Data Structures & Algorithms I by (110k points)
How do you initialize an array in C?

(a) int arr[3] = (1,2,3);

(b) int arr(3) = {1,2,3};

(c) int arr[3] = {1,2,3};

(d) int arr(3) = (1,2,3);

Origin of the question is Array and Array Operations in chapter Abstract Data Types of Data Structures & Algorithms I

The question was posed to me by my college director while I was bunking the class.

1 Answer

+1 vote
by (412k points)
selected by
Best answer
Right answer is (c) int arr[3] = {1,2,3};

Explanation: This is the syntax to initialize an array in C.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.