Managed C++...
How do you get the command line string passed into the app?
Its for a console program.
Code:int main(?????)
{
Console::WriteLine("This is the command line: {0}", ?????);
Console::ReadLine();
return 0;
}
Printable View
Managed C++...
How do you get the command line string passed into the app?
Its for a console program.
Code:int main(?????)
{
Console::WriteLine("This is the command line: {0}", ?????);
Console::ReadLine();
return 0;
}
In C you add the following two arguments to main:
int main (int argc, char * argv[])
The first argument is the number of command line arguments passed and the second is an array of pointers to char which point to each command line string.
I'm not sure if it is different in C++, but worth are try.
by argc and argv
Same in C++, but Managed C++ might use a managed String array.