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
How can I discover how many arguments a function was actually called with?
When should a far pointer be used?
What are the primitive data types in c?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
Is stack a keyword in c?
write a program to display all prime numbers
What is an expression?
Can you write the algorithm for Queue?
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above
Explain the difference between structs and unions in c?
Why is sizeof () an operator and not a function?
Explain what are multibyte characters?
What is the advantage of c?
What is array within structure?
What are the disadvantages of external storage class?