fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. struct Atom {
  6. int multiplier;
  7. string part;
  8. };
  9.  
  10. vector<Atom> cracking(string chemform) {
  11. return { { 10, chemform }, { 20, "teste" } };
  12. }
  13. int main() {
  14. vector<Atom> atoms =cracking("item");
  15. cout << atoms[0].multiplier << " " << atoms[0].part << endl;
  16. cout << atoms[1].multiplier << " " << atoms[1].part << endl;
  17. }
  18.  
  19. //https://pt.stackoverflow.com/q/262791/101
Success #stdin #stdout 0s 4508KB
stdin
Standard input is empty
stdout
10 item
20 teste