• Saves Valuable Time
  • Trusted Accuracy for 12 Years
  • 15-Day Money-Back Guarantee

C# Equivalent to C++ std::vector

The nearly exact C# equivalent to the C++ std::vector collection is the .NET List collection.

C++ C#
#include <vector>

void Vector()
{
    std::vector<int> myList;
    myList.push_back(1);
    int i = 1;
    myList[0] = i;
    i = myList[0];
}
using System.Collections.Generic;

void Vector()
{
    List<int> myList = new List<int>();
    myList.Add(1);
    int i = 1;
    myList[0] = i;
    i = myList[0];
}


Use C++ to C# Converter to convert from C++ to C#.     

Additional resource: C++ and C# Equivalents


Copyright © 1997 – 2017 Tangible Software Solutions Inc.