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 value is returned to operating system after program execution?
What is a good data structure to use for storing lines of text?
What is data type long in c?
What does int main () mean?
explain what are pointers?
Tell us bitwise shift operators?
Explain how can you avoid including a header more than once?
What is c token?
Explain what is wrong in this statement?
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
main() { printf("hello"); fork(); }
What is a void * in c?
Why can’t constant values be used to define an array’s initial size?
What are the advantages of Macro over function?
Explain how can you check to see whether a symbol is defined?