I am trying to create a program that will create a vector, generate 100 random numbers (0 – 99) and then ask for user input whether they want the numbers sorted from High to Low or Low to High.
This is the code I have so far just trying to get the vector working.
using System;
using System.Collections.Generic;
using System.Collections.Generic.List; //this is where the error comes.
using System.Linq;
using System.Text;
namespace System.Collections.Generic
{
class List<T>
{
static void Main(string[] args)
{
List<int> vectorList = new List<int>();
vectorList.Capacity(100);
int i = 100;
for (int x = 0; x <= 100; x++)
{
Random rand = new Random();
i = rand.Next(0, 100);
vectorList.Add(i);
Console.WriteLine(i);
}
}
}
}
Except I have no idea how to fix this issue, any help would be much appreciated.
It’s a side issue (BoltClock has it right), but change this:
To this:
Also, remove the
<T>from your class name.