online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include<iostream> #include<iomanip> using namespace std; void inicializar_matriz(int **p, int filas, int columnas); void mostrar_matriz(int **p, int filas, int columnas); int main() { int fil = 0, col = 0; srand(time(nullptr)); cout << "filas\t\t\t: "; cin >> fil; cout << "columnas\t\t: "; cin >> col; int** matriz = new int*[fil]; // asignando espacio para el arreglo de direccines matriz[0] = new int[fil*col]; // asignando espacio para la matriz de enteros for (int j=1; j<fil; ++j) // inicializando el arreglo de direcciones matriz[j] = matriz[0] + j*col; inicializar_matriz(matriz, fil, col); mostrar_matriz(matriz, fil, col); delete[] matriz[0]; // liberando espacio asignado para la matriz de enteros matriz[0] = nullptr; delete[] matriz; // liberando espacio asignado para la matriz de direcciones matriz = nullptr; } void inicializar_matriz(int **p, int filas, int columnas) { for (int j = 0; j < filas; ++j) for (int k = 0; k < columnas; ++k) p[j][k] = rand()%21; } void mostrar_matriz(int **p, int filas, int columnas) { for (int j = 0; j < filas; ++j) { cout << "Notas de estudiante " << j << ":"; for (int k = 0; k < columnas; ++k) cout << setw(4) << p[j][k]; cout << endl; } }

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