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


Please Help Members By Posting Answers For Below Questions

will u please send me the placement papers to my mail???????????????????

1365


How many types of operators are there in c?

615


Why are algorithms important in c program?

620


Explain data types & how many data types supported by c?

584


How to declare pointer variables?

686






What is difference between union and structure in c?

578


Explain what header files do I need in order to define the standard library functions I use?

649


What are local variables c?

551


What is the difference between volatile and const volatile?

565


How can I implement sets or arrays of bits?

607


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

2609


How can I find the modification date of a file?

705


How do you declare a variable that will hold string values?

670


What does nil mean in c?

672


What is the general form of function in c?

610