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
How can you increase the size of a statically allocated array?
What is NULL pointer?
Are there any problems with performing mathematical operations on different variable types?
Differentiate between functions getch() and getche().
What do you mean by command line argument?
How do you view the path?
Do you know the use of 'auto' keyword?
explain what is a newline escape sequence?
What is an identifier?
Which of the following operators is incorrect and why? ( >=, <=, <>, ==)
How can I read a binary data file properly?
Why we use void main in c?
What are file streams?
Why #include is used in c language?
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.