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 / yatish m yadav
The wrong answer is
d> *(*pa+5)
here value pointed to by pa is accessed and added 5 to it
then trying to print the value at that address, which gives
us an warning with some garbage value.
Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
Why doesnt this code work?
which is an algorithm for sorting in a growing Lexicographic order
Who developed c language?
Is it possible to execute code even after the program exits the main() function?
What is the explanation for the dangling pointer in c?
What is bubble sort in c?
How do you construct an increment statement or decrement statement in C?
Write a program on swapping (100, 50)
Why is main function so important?
What is realloc in c?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
provide an example of the Group by clause, when would you use this clause
What is nested structure with example?
What is getch () for?
What are pointers?