Answer Posted / bijayalaxmi behera.
The index of an array is an OFFSET from the beginning of the
array, multiplied by the width of the array items:
Say an array of integers, 4 bytes long.
Say beginning of array at address 0x1000
First integer address: BaseAddress + (index * len) = 0x1000
+ ( 0 * 4) = 0x1000
Second integer will be at : 0x1000 + ( 1 * 4 ) = 0x1004.
| Is This Answer Correct ? | 4 Yes | 6 No |
Post New Answer View All Answers
What functions are used in dynamic memory allocation in c?
How can I find the modification date and time of a file?
Tell me when would you use a pointer to a function?
What is the use of printf() and scanf() functions?
write a program to copy the string using switch case?
How would you obtain the current time and difference between two times?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?
how can f be used for both float and double arguments in printf? Are not they different types?
What is a #include preprocessor?
Explain why can’t constant values be used to define an array’s initial size?
#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
What is #define?
Write a program to reverse a string.