online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, C#, OCaml, VB, Perl, Swift, Prolog, Javascript, Pascal, COBOL, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <iostream> #include <string> using namespace std; // Csupan egy tipust keszitunk struct Nev { string keresztnev; string csaladnev; }; int main() { const int MAX_N = 5; int n = 0; // Ezt peldanyositjuk MAX_N darabszamban a stack-en Nev nevek[MAX_N]; cout << "Mennyi nev lesz?" ; cin >> n; // Vedelem, ha a felhasznalo tul sok adatot akarna beirni, kulonben elfogadjuk a bevitt szamot if (n > MAX_N) { cout << "Maximum " << MAX_N << " nev lesz tarolva" << endl; n = MAX_N; } // Bekerjuk, a tombbe ahol az elso elem a 0. !!! for (int i=0; i<n; i++) { cout << i + 1 << ". keresztnev: "; cin >> nevek[i].keresztnev; cout << i + 1 << ". csaladnev: "; cin >> nevek[i].csaladnev; } // Ellenorzes keppen kiirjuk az osszes adatot cout << "Beirt nevek:" << endl; for (int i=0; i<n; i++) { cout << nevek[i].csaladnev << " " << nevek[i].keresztnev << endl; } 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