online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <bits/stdc++.h> using namespace std; struct Book{ char Product[5]; int Price; int SeqNum; } b[5]; struct Product { string id; vector<int> prices; }; Book* Load() { //Storing information for(int i=0;i<5;i++) { cout<<"Enter Product id"<<endl; cin>> b[i].Product; cout<<"Enter Price"<<endl; cin>> b[i].Price; b[i].SeqNum = i+1; cout<<b[i].SeqNum<<endl; } return b; } void Process(const Book* b) { map<string, Product> products; for(int i=0;i<5;i++) { vector<int> v; Product p; p.id = b[i].Product; //products.id = p.id; for(int j=0;j<5;j++) { if(strcmp((p.id).c_str(),b[j].Product) == 0) { v.push_back(b[i].Price); } p.prices = v; products[p.id] = p.prices; } } } int main() { Book* b = Load(); Process(b); 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