Is it wrong to use the main function in C++ Visual Studio 2017 as following:
int main(int argc, wchar_t* argv[])
as my program can receive special characters.
Please go and read the remarks section on GetCommandLine:
ANSI console processes written in C can use the argc and argv arguments of the main function to access the command-line arguments. ANSI GUI applications can use the lpCmdLine parameter of the WinMain function to access the command-line string, excluding the program name. The main and WinMain functions cannot return Unicode strings.
Unicode console process written in C can use the
wmain()or_tmain()function to access the command-line arguments. Unicode GUI applications must use the GetCommandLineW function to access Unicode strings.To convert the command line to an argv style array of strings, call the CommandLineToArgvW function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With