Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is static memory allocation?

1248


Why is structure important for a child?

1149


Is it possible to execute code even after the program exits the main() function?

1393


What do you mean by dynamic memory allocation in c?

1151


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

2926


which is an algorithm for sorting in a growing Lexicographic order

1866


How can you restore a redirected standard stream?

1174


What is meant by realloc()?

1204


How can I invoke another program or command and trap its output?

1151


program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)

2147


What are run-time errors?

1176


in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none

1156


List the variables are used for writing doubly linked list program.

2084


How is null defined in c?

1205


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

1127