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

Is c programming hard?

570


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

630


What is c programming structure?

614


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

1357


What is difference between array and pointer in c?

533






Difference between exit() and _exit() function?

650


What is floating point constants?

682


If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above

615


What will be the outcome of the following conditional statement if the value of variable s is 10?

755


Explain the advantages of using macro in c language?

570


In c programming language, how many parameters can be passed to a function ?

624


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

1896


write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.

3331


How does sizeof know array size?

617


What is the use of getch ()?

627