Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ======================HOW ITS DECLARED======================
- struct pinfo {
- int pstock; float pcost; string psku, pname;
- };
- const int maxproduct = 20;
- const int provals = 4;
- string prods [maxproduct] [provals];
- =============================================================
- to_string is used to convert float and int from struct here:
- ========================HOW ITS SAVED========================
- cout<<"\n\nEnter the Product Name: ";
- cin>>newproduct.pname;
- cout<<"\n\n Enter the Product SKU tag: ";
- cin>>newproduct.psku;
- cout<<"\n\n Enter the Product Stock: ";
- cin>>newproduct.pstock;
- cout<<"\n\n Enter the Product Cost in USD: ";
- cin>>newproduct.pcost;
- cout<<"\n\n This is what was entered:";
- prods [rowchoice] [0] = newproduct.pname;
- prods [rowchoice] [1] = newproduct.psku;
- prods [rowchoice] [2] = to_string(newproduct.pstock);
- prods [rowchoice] [3] = to_string(newproduct.pcost);
- =============================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement