why array index always strats wuth zero?
Answers were Sorted based on User's Feedback
Answer / sameer
it because arrays index are pointers and you are giving
offsets from the base pointer & base pointer is starting
element address so it has offset zero from base pointer
Is This Answer Correct ? | 11 Yes | 3 No |
Answer / surya.raj
Since I found this questions answer on a another website and
I can do copy and paste from there, but in order to make
copyright and royalty of original poster I am not tending to
do that so, here is the link below from where you can get
answer of your question.
http://developeronline.blogspot.com/2008/04/why-array-index-should-start-from-0.html
Is This Answer Correct ? | 2 Yes | 0 No |
how can i cast a char type array to an int type array
main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(“%u %u %u %d \n”,a,*a,**a,***a); printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1); }
How to reverse a String without using C functions ?
33 Answers Matrix, TCS, Wipro,
Code for 1>"ascii to string" 2>"string to ascii"
1 Answers Aricent, Global Logic,
main() { printf("\nab"); printf("\bsi"); printf("\rha"); }
main() { int i =0;j=0; if(i && j++) printf("%d..%d",i++,j); printf("%d..%d,i,j); }
Finding a number which was log of base 2
Which version do you prefer of the following two, 1) printf(“%s”,str); // or the more curt one 2) printf(str);
char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }
Write a program that find and print how many odd numbers in a binary tree
to remove the repeated cahracter from the given caracter array. i.e.., if the input is SSAD output should of SAD
Write a program to check whether the number is prime and also check if it there i n fibonacci series, then return true otherwise return false