C language 명령줄 인수 2020/12/08 21:34 by The 2nd


#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>


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

    printf("The command line has %d arguments:\n", argc);

    for (count = 0; count < argc; count++)
        printf("Arg %d : %s\n", count, argv[count]);
    printf("\n");

    return 0;   
}



C:\Users\사용자\source\HelloWorld\Debug>11.7.exe I am a boy. Glad to see you
The command line has 9 arguments:
Arg 0 : 11.7.exe
Arg 1 : I
Arg 2 : am
Arg 3 : a
Arg 4 : boy.
Arg 5 : Glad
Arg 6 : to
Arg 7 : see
Arg 8 : you

덧글

댓글 입력 영역