Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.38 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. class MyClass
  6. {
  7.    // Bla-bla-bla
  8. };
  9.  
  10. int main()
  11. {
  12.     std::vector<*MyClass> listObjects;
  13.     for (int i=0; i < 5; i++)
  14.     {
  15.         string makeObject;
  16.         cin >> makeObject;
  17.         if (makeObject == "1")
  18.         {
  19.            listObjects.push_back(new MyClass());
  20.         }
  21.     }
  22.     return 0;
  23. }