This line:
enum commandLine : int
should define following enums as int but no, it does not. What is wrong here?
using System;
enum commandLine : int
{
DRIVELETTER = 0,
URL
}
namespace not_int
{
class Program
{
static void Main(string[] args)
{
String driveLetter;
driveLetter = args[commandLine.DRIVELETTER]; // Cannot implicitly convert type 'commandLine' to 'int' ... Yes You Can!
driveLetter = args[(int)commandLine.DRIVELETTER]; // This works but feels like talking to a grown-up like he was a child:
// You see, here we have an integer but to you it looks like an integer of a different type. Here I tell you it's an integer of the type you want, like your candies ...
// This way you are happy like with your friday candy ...
}
}
}