Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // neno me podrias decir como hacer para crear arrays como objetos para poder sumarlos, llegue hasta ahi pero me fui cada vez liando mas,
- // lo que pretendo es crear arrays como objetos para poder sumar, introducir datos y visualizar. gracce
- #include <iostream>
- using namespace std;
- class Matriz{
- private:
- int fil;
- int col;
- int array[0][0];
- public:
- Matriz ();
- ~Matriz();
- void SetMatriz(int f, int c);
- void SumarMatriz();
- void visualizar();
- int Getfil();
- int Getcol();
- };
- Matriz::Matriz(){
- int f,c,v;
- cout<<"introduzca el numero de filas de la matriz: ";
- cin>> f;
- cout<<"introduzca el numero de columnas de la matriz: ";
- cin>> c;
- fil = f;
- col = c;
- array v = new array[f][c];
- }
- Matriz::~Matriz(){
- }
- void Matriz:: SetMatriz(int f, int c){
- int x;
- for(int i=0;i<f;i++){
- for(int j=0;j<c;j++){
- cout<<"introduzca el dato "<<i<<j<<" "<<endl;
- cin>>x;
- array[i][j]=x;
- }
- }
- }
- int Matriz::Getfil(){
- return fil;
- }
- int Matriz::Getcol(){
- return col;
- }
- void SumarMatriz(int a[int c][int d];int b[int c][int d]){
- }
- int main(){
- int fila,colu;
- Matriz m;
- fila = m.Getfil();
- colu = m.Getcol();
- m.SetMatriz(fila,colu);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement