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 / vignesh1988i
d) is the wrong choice...... because , first variable pa
refers to a address of the array... * of that pa will give
you the first value of the array.. ie a[0] , then that value
will be getting added with 5 and the * which is outside wont
have any value towards this manuplation...... so this will
show an error...... illegal use of pointers.....
thank u
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Can you subtract pointers from each other? Why would you?
Describe the order of precedence with regards to operators in C.
Write a program to check palindrome number in c programming?
What is "Duff's Device"?
Where register variables are stored in c?
What are valid operations on pointers?
hi send me sample aptitude papers of cts?
What does printf does?
What standard functions are available to manipulate strings?
What are the 4 types of programming language?
What is declaration and definition in c?
What is optimization in c?
What is the difference between memcpy and memmove?
how to execute a program using if else condition and the output should enter number and the number is odd only...
What is calloc() function?