Ask your own question, for FREE!
Computer Science 6 Online
OpenStudy (anonymous):

In C language, I want to print 2d array elements using pointers. I used this code : for(i=0;i<3;i++){ for(j=0;j<3;j++){ printf("%d \t",*(*(p+i)+j)); } printf("\n"); } But the compiler says : error : invalid type argument of unary '*' (have 'int') How to solve this?

OpenStudy (rsmith6559):

Whichever j you want, it would be found by adding: p + ( max( i ) * sizeof( j ) ) + ( sizeof( j ) * j ) and dereferencing the total.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Mari103: How to pop out like a Jacc In the box
7 hours ago 0 Replies 0 Medals
Breathless: Spooky witch but cute
14 hours ago 3 Replies 0 Medals
Arriyanalol: help
14 hours ago 10 Replies 2 Medals
Arriyanalol: @tinydinoUwU stop trying to find a argument u blad lil boy
1 day ago 5 Replies 4 Medals
Jaded012023: Please tell me what you all think of this song
17 hours ago 6 Replies 1 Medal
Arriyanalol: bro how
17 hours ago 2 Replies 3 Medals
Arriyanalol: cant wait for the new bluey movie in 2027
1 day ago 12 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!