请问带参的main怎么执行呀 我做了很多次, 可是就是得不到要的结果呀, 这个程序如下: #include <stdio.h> #include <io.h>
void main (int argc, char *argv[]) { int access_mode;
access_mode = access(argv[1], 0); if (access_mode) printf("File %s does not exist\n"); else { access_mode = access(argv[1], 2);
if (access_mode) printf("File cannot be written\n"); else printf("File can be written\n");
access_mode = access(argv[1], 4);
if (access_mode) printf("File cannot be read\n"); else printf("File can be read\n"); access_mode = access(argv[1], 6);
if (access_mode) printf("File cannot be read/write\n"); else printf("File can be read/write\n"); } } 它对应的。exe在c:\tc\Bin\access.exe