Dev - C++ - PUNTEROS Y MATRICES

 
Vista:

PUNTEROS Y MATRICES

Publicado por Katia Luz (1 intervención) el 20/01/2009 16:44:02
Tengo este programa en C++ pero en Visual C++ 6.0 no corre y en Turbo C si... por que??
#include <iostream.h>
#include <stdlib.h>
#include <conio.h>
void main()
{ int **mat, i,j,N=3,M=2;
mat= (int **) malloc((N*M)*sizeof(int));
if(mat==NULL)
{cout<<"ERROR";}
else
{for(i=0;i<N;i++)
{ for(j=0;j<M;j++)
{ cin>>*(*(mat+i)+j);
}
}
for(i=0;i<N;i++)
{ for(j=0;j<M;j++)
{ cout<<*(*(mat+i)+j);
}
cout<<endl;
}
}
getch();
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder