Why array starts with index 0

Answers were Sorted based on User's Feedback



Why array starts with index 0..

Answer / saurabh upman

Index is used as an offset value.Giving value 0 to the starting address means that we are 0 element far from the destination in a contigious memory arrangment.It makes the indexing a coherent offset to be assigned.

Is This Answer Correct ?    0 Yes 0 No

Why array starts with index 0..

Answer / gopesh dubey

Because the name of array is a pointer

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

what r callback function?

1 Answers  


what is the output of the following program? main() { int c[]={2,8,3,4,4,6,7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf("%d",*c); ++q; } for(j=0;j<5;j++) { printf("%d",*p); ++p; } }

4 Answers  


Write a factorial program using C.

0 Answers   iNautix,


Using which language Test cases are added in .ptu file of RTRT unit testing???

0 Answers  


What does struct node * mean?

0 Answers  






What does *p++ do? What does it point to?

0 Answers  


What is meant by 'bit masking'?

0 Answers  


how the size of an integer is decided? - is it based on processor or compiler or OS?

19 Answers   HCL, JPR, Microsoft, nvidia,


Write a program for finding factorial of a number.

0 Answers   Tech Mahindra,


String concatenation

2 Answers  


wat are the two methods for swapping two numbers without using temp variable??

2 Answers  


prototype of sine function.

2 Answers   Cadence,


Categories