Hi, I'm wanting to pass a value such as 3 to my program when I run it from the command prompt. How can I do this? Everything I try just either doesn't work or gives me errors

Basically I have a menu screen and when I type the number 3 for example:

C:\>Myprogram.exe 3

I want it to pass the value 3 in to my program and automatically select the 3rd element in the menu.

At the momemt all its doing is running the program and displaying the menu.

Any ideas?

Here is what I have so far:

void main(int argc, char *argv[])

// Additional arguments to enable running of the program from the //DOS prompt

{

int menunumber=(int)argv[1];

// etc etc...

Cheers

CaptainChainsaw