Pointers with 2d arrays ......

http://www2.0zz0.com/2016/05/06/18/416072045.jpg

Comeplete program for the pic please
Please note that this is not a homework site. We won't do your homework for you. The purpose of homework is that you learn by doing. However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.

We didn't see your attempts to solve this problem yourself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem is "I don't understand a thing", then you should go back to basics and study again.
Thats the problem . Our teacher didnt teach us how to swap 2d arrays to a function . So i googled it and didnt understand how it works . I have been trying to code it for 4 hours

My try is in the next replay



Ps : in my country we still coding with borland c++ . So dont judge xD

Sorry for my stupid english
closed account (E0p9LyTq)
Osaid wrote:
Comeplete program for the pic please


Ok, done.

Oh, you want me to post the code so you don't have to do your homework?

Not going to happen.
#include<iostream.h>
#include<time.h>
#include<stdlib.h>

main ()
{int m[3][3];
srand(time(0)) ;
for (int i=0;i<=2;i++){
for (int j=0;j<=2;j++)
{m[i][j]=(rand()% 10) ;} }
void modify(int m) ;
}
Last edited on

void modify(int p[3][3]){
for(int a=0 ; a<=2 ; a++)
for(int b=0 ; b<=2 ; b++)
if (p[a][b]%2==0)
p[a][b]=p[a][b]*2 ;
else
p[a][b]=p[a][b]*-1;

void row_sum(int p);
}
Last edited on
void row_sum(int q[3][3])
{
int n[3] ;

for (int l=0 ; l<=2 ; l++)
n[l]= q[l][0] + q[l][1] + q[l][2] ;

for (int h=0 ; h<=2 ; h++)
cout<<n[h]<<endl ; }
@ Osaid,

Does the code supposed to work like the link below?
https://www.youtube.com/watch?v=scfDKaB9DuU

You may want to take a look at the array tutorial:
http://www.cplusplus.com/doc/tutorial/arrays/
Topic archived. No new replies allowed.