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 is the return type of sizeof?
What are the advantages of using macro in c language?
What is the use of static variable in c?
Is array name a pointer?
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
What is the difference between int main and void main in c?
Describe static function with its usage?
What does char * * argv mean in c?
Explain the difference between call by value and call by reference in c language?
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
Write a program on swapping (100, 50)
How can I do serial ("comm") port I/O?
What is identifiers in c with examples?
What is c programing language?
How do you write a program which produces its own source code as output?