Tangible Software Solutions

The Most Trusted Name in Source Code Conversion

C# Equivalent to C++ std::vector

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

Original C++:

#include <vector>

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

Equivalent C#:

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

If you need to convert from C++ to C# and you are depending on the results being reliable and accurate, then you will want to have C++ to C# Converter, the best C++ to C# converter, at your fingertips.

Copyright © 1997 - 2017 Tangible Software Solutions Inc.