online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
//Programa para demostrar arreglos dinámicos de estructuras #include <iostream> #include <string> using namespace std; struct TeleType{ string name; string phoneNo; }; void populate(TeleType *);//Prototipo void dispOne(TeleType *); //Prototipo int incrementa(TeleType *, int); //Prototipo int main() { int flag=0; int numreg=0; // numero de registros TeleType *recPoint; //recPoint es un puntero a una //estructura de tipo Teletype cout<<"cuantos registros desea ingresar?: "; cin>>numreg; cin.ignore(1); flag = incrementa(recPoint, numreg); return 0; } //Ingresar un nombre y un numero de telefono void populate(TeleType *record) //record es un puntero a una { //estructura de tipo Teletype cout<<"Ingrese un Nombre: "; getline(cin,record->name); cout<<"Ingrese el Número Telefónico: "; getline(cin,record->phoneNo); return; } //Muestra el contenido de un registro void dispOne(TeleType *contents) //contents es un puntero a una { //estructura de tipo Teletype cout<<"\nNombre:"<<contents->name <<"\nNúmero Telefónico: "<<contents->phoneNo<<endl; return; } int incrementa(TeleType *pt, int num){ pt = new TeleType[num]; // se asigna memoria dinámica for(int i=0; i<num; ++i) populate(pt+i); // el puntero (pt+i) apunta a un //elemento del arreglo de estructuras cout<<"El directorio ingresado es:\n"; for (int i=0; i<num; ++i) dispOne(pt+i); delete [] pt ; // se desasigna la memoria return 0; }

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