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

How do you define structure?

1006


void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

2719


What is difference between structure and union in c programming?

1043


How do I round numbers?

971


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

3485


Write a program to check prime number in c programming?

1047


how to execute a program using if else condition and the output should enter number and the number is odd only...

2228


How will you divide two numbers in a MACRO?

1086


What is the difference between malloc calloc and realloc in c?

1091


How do you determine a file’s attributes?

1030


What happens if header file is included twice?

1102


What are 3 types of structures?

1035


Is null always defined as 0(zero)?

1060


What is the deal on sprintf_s return value?

1079


Is printf a keyword?

1164