online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <iomanip> #include <limits> using namespace std; const int CAPACIDAD = 5; typedef struct { char nombre[CAPACIDAD]; int precio; } Producto; int main() { Producto* ptr = new Producto; ptr[0].precio = 3; // tb se puede usar ptr->precio = 3; cout << "nombre del producto\t:\t"; cin.getline(ptr[0].nombre, CAPACIDAD, '\n'); if (cin.fail()) { cin.clear(); cin.ignore(numeric_limits<streamsize>::max(), '\n'); } cout << "\t\t\t" << setw(CAPACIDAD) << "Nombre" << "\tPrecio\n"; cout << "Item\t:\t" << setw(CAPACIDAD) << ptr[0].nombre << "\t\t" << ptr[0].precio << endl; delete ptr; ptr = nullptr; }

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