fork(1) download
  1. #include<iostream>
  2. #include<string>
  3.  
  4. const int Arrsize = 30;
  5. using namespace std;
  6.  
  7. int main() {
  8. struct pizza {
  9. //char name[Arrsize];
  10. string name;
  11. double diameter;
  12. double weight;
  13. };
  14.  
  15.  
  16. pizza * new_dish = new pizza;
  17.  
  18. cout << "Pizza Composing:\n-------------------\n";
  19. cout << "Diameter: ";
  20. cin >> new_dish->diameter;
  21. cout << "Name: ";
  22. //cin.get(new_dish->name, Arrsize);
  23. cin>>new_dish->name;
  24. cout << "Weight: ";
  25. cin >> new_dish->weight;
  26. cout << "-------------------\n";
  27.  
  28. cout << new_dish->name << endl << new_dish->diameter << "cm " << new_dish->weight << "g."<<endl<<endl;
  29. delete new_dish;
  30.  
  31. system("pause");
  32. return 0;
  33.  
  34.  
  35. }
Success #stdin #stdout #stderr 0s 3432KB
stdin
12
kutas
40
stdout
Pizza Composing:
-------------------
Diameter: Name: Weight: -------------------
kutas
12cm 40g.

stderr
sh: pause: not found