edited by
681 views

1 Answer

2 votes
2 votes

 

0 1
2 3

arr                                

1000

ptr

 

ptr is a pointer to 1D array of size 2

assume that base address of first row is 1000

**ptr+=1 

⇒ *ptr will point to first element of first row then one more time start will be first element of row

⇒ **ptr=**ptr+1=0+1=1

⇒ ptr++ is a pointer arithmetic it is depend on type of pointer

⇒ as ptr is pointer to array ptr++ will point to second row of array

⇒ **ptr*=3

⇒ *ptr will point to first element of second row then one more star will be first element of that row

⇒ **ptr=**ptr*3=2*3=6

final array is:

1 1
6 3

 

Related questions

1 votes
1 votes
2 answers
1
gateranker asked Aug 25, 2023
378 views
$L_1=a^ * b^ *$$L_2=a^ + b^ +$Find $L_2-L_1$:A. $a ^ *$B. $b ^ *$C. $a ^ * +b^ *$D. None