while initialization of two dimensional arrays we can
initialize like a[][2] but why not a[2][] is there any
reason behind this?
Answer Posted / kathir
Lets assume an arry arr[][3] = {..};
if you want to refer arr[1][2] then the reference to the
element will be identified using the following formula,
arr[1*NoOfColoumns(=3) + 2](you can consider it as a single
dimension array storing values in sequence).
Hence to get the address of any element in the array you
only require column info NOT rows.Thats why compiler does
not bother about no of rows!
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the difference between volatile and const volatile?
How are pointers declared in c?
What is line in c preprocessor?
What is double pointer?
Why is c still so popular?
What are the two types of functions in c?
Explain what does the format %10.2 mean when included in a printf statement?
What are structure members?
List some of the dynamic data structures in C?
Calculate 1*2*3*____*n using recursive function??
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
What is a pointer on a pointer in c programming language?
What is the use of header files?
Mention four important string handling functions in c languages .