Read input.txt file and also output.bmp file from terminal (C-programming)

≡放荡痞女 提交于 2019-11-28 14:22:00

The full prototype for a standard main() is

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

You get an int with the number of arguments, argc and
a list of "strings" (as far as they exist in C), argv.

You can for example use

#include "stdio.h"
int main(int argc, char* argv[])
{

    printf("Number: %d\n", argc);
    printf("0: %s\n", argv[0]);
    if (1<argc)
    {
        printf("1: %s\n", argv[1]);
    }
}

to start playing with the arguments.

Note that this is intentionally not implementing anything but a basic example of using command line parameters. This matches an accpeted StackOverflow policy of providing help with assignments, without going anywhere near solving them.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!