given the piece of code
int a[50];
int *pa;
pa=a;
to access the 6th element of the array which of the
following is incorrect?
a.*(a+5)
b.a[5]
c.pa[5]
d.*(*pa + 5)
Answer Posted / vignesh1988i
d) is the wrong choice...... because , first variable pa
refers to a address of the array... * of that pa will give
you the first value of the array.. ie a[0] , then that value
will be getting added with 5 and the * which is outside wont
have any value towards this manuplation...... so this will
show an error...... illegal use of pointers.....
thank u
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is return in c programming?
Which of these functions is safer to use : fgets(), gets()? Why?
How can you tell whether two strings are the same?
What is the size of empty structure in c?
What does %d do in c?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
Subtract Two Number Without Using Subtraction Operator
Explain what are header files and explain what are its uses in c programming?
What are the types of type specifiers?
What are multidimensional arrays?
What are the advantage of c language?
Tell us something about keyword 'auto'.
What is the difference between printf and scanf )?
Why is structure padding done in c?
How can I implement a delay, or time a users response, with sub-second resolution?