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 / karthik

void main()
{
int a[50]={1,2,3,4,1,55};
int *pa;
pa=a
printf("%d",*(pa+5));
}

we will the sixth element

its not pointer to the pointer ie *(*pa+5);

Is This Answer Correct ?    36 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c language used for?

559


hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...

1443


write a c program for swapping two strings using pointer

2094


Write a program to check whether a number is prime or not using c?

576


What are c header files?

581






How to implement a packet in C

2396


Can you please compare array with pointer?

616


What is typedef?

676


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

3501


Is array a primitive data type in c?

579


Write a program to print "hello world" without using a semicolon?

595


Under what circumstances does a name clash occur?

690


What is #line in c?

563


What is d'n in c?

636


I have seen function declarations that look like this

602