请看一个关于转换大小写的问题
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int main(int argc, char **argv)
{
int (*convcase[2])(int) = {toupper, tolower};
int func;
int result = EXIT_SUCCESS;
int ch;
if(argc > 0)
{
if(toupper((unsigned char)argv[0][0]) == 'U')
{
func = 0;
}
else
{
func = 1;
}
while((ch = getchar()) != EOF)
{
ch = (*convcase[func])((unsigned char)ch);
putchar(ch);
}
}
else
{
fprintf(stderr, "Unknown name. Can't decide what to do.\n");
result = EXIT_FAILURE;
}
return result;
}
假设此程序生成的1.exe文件是在d盘根目录下,那么我在命令行输入D:\1.exe Ualsdkjf,那么argv[0][0]是U吗?VC中我不知道如何运行类似的程序,请指点。