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


Please Help Members By Posting Answers For Below Questions

How can you increase the size of a statically allocated array?

612


What is NULL pointer?

675


Are there any problems with performing mathematical operations on different variable types?

575


Differentiate between functions getch() and getche().

622


What do you mean by command line argument?

644






How do you view the path?

670


Do you know the use of 'auto' keyword?

662


explain what is a newline escape sequence?

690


What is an identifier?

626


Which of the following operators is incorrect and why? ( >=, <=, <>, ==)

665


How can I read a binary data file properly?

635


Why we use void main in c?

597


What are file streams?

572


Why #include is used in c language?

598


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.

1212