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 ? | 38 Yes | 4 No |
Post New Answer View All Answers
How can a number be converted to a string?
What are data structures in c and how to use them?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
Is fortran faster than c?
How do you do dynamic memory allocation in C applications?
How can I trap or ignore keyboard interrupts like control-c?
What is declaration and definition in c?
the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?
Write a simple code fragment that will check if a number is positive or negative.
What is the use of a conditional inclusion statement in C?
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
What is array of pointers to string?
while initialization of array why we use a[][2] why not a[2][]...?
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
What is use of #include in c?