480 views

3 Answers

Best answer
1 votes
1 votes
C) a=p is not a valid statement.p=a is valid as we are assigning the address of a[0] to p. p=a+2 is valid assigning address of a[2] to p.

p=&a[2] is same as previous.
selected by
3 votes
3 votes

Answer : C 

This is not a valid assignment because "a" is not a variable here and there is no space allocated for "a" in the memory it is just a nemonic  .

edited by
0 votes
0 votes
base address of an array is constant .so we cannot increment,decrement its value....and cannot assign any value to it

if we assign we will get an error i.e "l value required"

so OPTION C IS NOT VALID.

Related questions

0 votes
0 votes
1 answer
4
shivam sharma 5 asked Aug 28, 2018
575 views
give the complete solution with explanationint main(){ int arr = {10,2,3,4,5,6,7,8}; int *p, *q; p = &arr ; q = (int*) arr; printf("%d ,%d \n",*p...