online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
// 3a.cpp #include <iostream> #include <iomanip> using namespace std; void generar(char * cad, int n); void mostrar(char * cad, int n); int main() { char cadena[51]; srand(time(nullptr)); generar(cadena,50); cout << cadena << endl; mostrar(cadena,50); } void generar(char * cad, int n) { int k; for (int j = 0; j < n; ++j) { k = rand()%27; if (k == 0) cad[j] = k + 46; else cad[j] = k + 96; } cad[n] = 0; } void mostrar(char * cad, int n) { cout << "Cadena transformada:" << endl; for (int j = 0; j < n; ++j) { cout << cad[j]; if (cad[j] == 46 && j+1 < n) { if (cad[j+1] >= 97) { cout << " "; cad[j+1] = cad[j+1] - 32; } } } 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