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 value is returned to operating system after program execution?

2109


What is a good data structure to use for storing lines of text?

1080


What is data type long in c?

1074


What does int main () mean?

1016


explain what are pointers?

1009


Tell us bitwise shift operators?

1090


Explain how can you avoid including a header more than once?

1088


What is c token?

1064


Explain what is wrong in this statement?

1114


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......

1868


main() { printf("hello"); fork(); }

1187


What is a void * in c?

1071


Why can’t constant values be used to define an array’s initial size?

1371


What are the advantages of Macro over function?

1999


Explain how can you check to see whether a symbol is defined?

1159