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 ? | 5 Yes | 1 No |
Post New Answer View All Answers
What are near, far and huge pointers?
What is a const pointer in c?
What is the right way to use errno?
What is p in text message?
What is sizeof int?
write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.
What is a header file?
What are the 3 types of structures?
What does %p mean?
Write a program to print “hello world” without using semicolon?
What is the difference between text files and binary files?
What is the most efficient way to store flag values?
Is main is a keyword in c?
What is void main ()?
What is difference between scanf and gets?