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 c variable?
What are reserved words?
How will you declare an array of three function pointers where each function receives two ints and returns a float?
How do c compilers work?
How do you redirect a standard stream?
Why is c known as a mother language?
Tell me is null always defined as 0(zero)?
Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.
which type of aspect you want from the student.
What is the process of writing the null pointer?
Differentiate abs() function from fabs() function.
Why do we write return 0 in c?
What is string in c language?
What's a good way to check for "close enough" floating-point equality?
Explain 'far' and 'near' pointers in c.