online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <new> using namespace std; void generarMatriz(int **ptMatriz, int n, int m); void mostrarMatriz(int **ptMatriz, int n, int m); int ** liberarMemoria(int **ptMatriz, int n); int main () { int i, filas, columnas; cout<<"filas, columnas: "; cin>>filas>>columnas; int ** Matriz = new (nothrow) int*[filas]; if(Matriz == nullptr) cout<<"Error: no se pudo asignar la memoria"; else { for(i=0; i<filas; i++) Matriz[i] = new int[columnas] ; } generarMatriz(Matriz, filas,columnas); mostrarMatriz (Matriz, filas,columnas); // Desasignar la memoria dinámica: Matriz = liberarMemoria(Matriz, filas); return 0; } void mostrarMatriz(int **ptMatriz, int n, int m){ for (int i=0; i<n; i++){ for (int j=0; j<m; j++){ cout<<" \t"<<ptMatriz[i][j]; } cout<<endl; } } void generarMatriz(int **ptMatriz, int n, int m){ srand(time(NULL)); for (int i=0 ; i<n; i++){ for (int j=0 ; j<m; j++) ptMatriz[i][j]= 1+ rand()%99; } } int ** liberarMemoria(int **ptMatriz, int n){ for (int i=0; i<n; i++){ cout<<"elemento: "<<*ptMatriz[i]; delete [] ptMatriz[i]; cout<<" - "<<*ptMatriz[i]<<endl; } delete [] ptMatriz; ptMatriz = NULL; return ptMatriz; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue