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
How do you define structure?
void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply
What is difference between structure and union in c programming?
How do I round numbers?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
Write a program to check prime number in c programming?
how to execute a program using if else condition and the output should enter number and the number is odd only...
How will you divide two numbers in a MACRO?
What is the difference between malloc calloc and realloc in c?
How do you determine a file’s attributes?
What happens if header file is included twice?
What are 3 types of structures?
Is null always defined as 0(zero)?
What is the deal on sprintf_s return value?
Is printf a keyword?