while initialization of two dimensional arrays we can
initialize like a[][2] but why not a[2][] is there any
reason behind this?
Answers were Sorted based on User's Feedback
Answer / prady
2 dimension array a[row][col]; in this 'col' indicates size
of block,and 'row' indicates no. of blocks.
Compiler prefer memory unit size first rather no.of memory
units.
| Is This Answer Correct ? | 25 Yes | 1 No |
the main reason behind this is that, if we specify the
columns instead of rows we can easily find out the number of
rows in the matrix...... but if we give just row number we
cant predict the number of columns...... that's why !!!!!!
thnak u
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / 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 |
Answer / subhrajeet sairam mohanty
2 dimension array a[row][col]; in this 'col' indicates size
of block,and 'row' indicates no. of blocks.
Compiler prefer memory unit size first rather no.of memory
units.
| Is This Answer Correct ? | 0 Yes | 0 No |
program for validity of triangle from 3 side
Write a function in c to find the area of a triangle whose length of three sides is given.
What are the back slash character constants or escape sequence charactersavailable in c?
What is c programing language?
What is the use of pointers in C?
0 Answers Impetus, Motorola, Tavant Technologies, Virtusa,
what is difference between C and C++
What are the advantages of Macro over function?
How can I handle floating-point exceptions gracefully?
what is the difference between while and do while?
Please write me a program to print the first 50 prime numbers (NOT between the range 1 -50)
What would happen to X in this expression: X += 15; (assuming the value of X is 5)
consider the following C code main() { int i=3,x; while(i>0) { x=func(i); i--; } int func(int n) { static sum=0; sum=sum+n; return(sum); } the final value of x is