previous | start | next

2.5 Example (template version)

int main()
{
  // declare an empty Array (of integers)
  Array<int> a;
  
  // Insert numbers at the end
  for(int i = 0; i < 10000; i++) {
    a.add(i);
  }

  // Print the items in the Array a

  for(int i = 0; i < a.size(); i++) {
     cout << a.at(i) << endl;
  }

  return 0;
}
 


previous | start | next