본문 바로가기
C C++

콘솔로 프로그램 실행 및 명령어

by AYAYz 2019. 10. 8.
#include <iostream>
#include <cstring>

int main(int argc, char **argv){
    if(strcmp(argv[1], "x") == 0){
        printf("HELLO\n");
    }
}

이러고

리눅스 bash에서 g++ -o test main.cpp 로 컴파일 해준뒤

./test x를 치면 HELLO가 실행된다

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

.

.

.

 

 

 

 

 

 

 

 

 

 

 

 

 

.

댓글