본문 바로가기

Series

Add C++ Command Arguments [Visual Studio]

Visual Studio에서 Command Line Arguments를 입력한 후, 프로그램을 실행해보자.


Command Line Arguments는 아래와 같이 입력하면 된다.


Project > Properties > Configuration Properties > Debugging > Command Arguments






Command Arguments로 Hello World를 입력한 후, 아래 예제 프로그램을 실행해보자.


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

{

  for (int var = 0; var < argc; ++var)

  {

    cout << var << " : " << argv[var] << endl;

  }

 

  return EXIT_SUCCESS;

}



출력 결과는 아래와 같다.





'Series' 카테고리의 다른 글

Add C++ Program Arguments [CLion]  (0) 2018.06.30
Add C++ Program Arguments [Eclipse]  (0) 2018.06.30
Set C++ Standard Option [CLion]  (0) 2018.06.30
Set C++ Standard Option [Eclipse]  (0) 2018.06.30
Set C++ Standard Option [Intel Parallel Studio]  (0) 2018.06.30