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


Please Help Members By Posting Answers For Below Questions

Why doesnt this code work?

626


which is an algorithm for sorting in a growing Lexicographic order

1405


Who developed c language?

646


Is it possible to execute code even after the program exits the main() function?

832


What is the explanation for the dangling pointer in c?

688






What is bubble sort in c?

650


How do you construct an increment statement or decrement statement in C?

757


Write a program on swapping (100, 50)

649


Why is main function so important?

626


What is realloc in c?

585


illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question

1596


provide an example of the Group by clause, when would you use this clause

1718


What is nested structure with example?

641


What is getch () for?

687


What are pointers?

642