티스토리 뷰

이 페이지를 작성한 이유는 각종 코딩 시험에서 input.txt로 입력이 주어질때 비주얼 스튜디오(visual studio)에서는 

상단메뉴 디버그 -> 속성 -> 구성속성의 디버깅 -> 명령인수에 <input.txt >output.txt를 쓰면 되었다.

관련 링크 : http://blog.naver.com/PostView.nhn?blogId=dhdh6190&logNo=220733573689&parentCategoryNo=&categoryNo=&viewDate=&isShowPopularPosts=false&from=postView

 

비주얼 스튜디오에서 입력으로 파일 들어가게 리다이렉션 설정하기 (visual studio input file redirection)

나의 청년 치매가 또 도져서 다음에 방법 까먹고 삽질할 것 같아서 기록으로 남긴다. 사실 이거 구글링하면...

blog.naver.com

그러나 맥북의 xcode에서는 이러한 비슷한 걸 찾기 힘들었고, 그나마 비슷한 환경으로 실행하는 찾아 설명하도록 하겠다.

 

1. 먼저 run 후, xcode의 프로젝트 탐색기(기본적으로 왼쪽에 있는 곳)에서 exec 파일에서 마우스 오른쪽 버튼을 누른다.

2. show in finder를 누른다.

3. 그 폴더에 input.txt를 드래그앤 드랍로 위차한다.

4. 여기 폴더에서 터미널을 연다. 터미널을 쉽게 열기위해, 다음 프로그램을 설치한다. 

https://zipzapmac.com/Go2Shell

 

Go2Shell - ZipZapMac

Go2Shell Instant Terminal Window Opens a terminal window to the current directory in Finder. Over 100K Happy Users. Built for Power Terminal Users Go2Shell opens a terminal window to the current directory in Finder. First - Launch Go2Shell. Then - Select y

zipzapmac.com

5. 이 프로그램을 실행하면 현재 활성화 되어있는 finder의 경로로 terminal을 실행한다. 

6. 이제 여기에 ./"파일명" <input.txt 하면 된다. output.txt로 결과를 출력하고 싶으면  ./"파일명" <input.txt >output.txt로 해준다. 매번 run할때마다 해야하니 귀찮을 수도 있음

댓글
공지사항
최근에 달린 댓글
Total
Today
Yesterday
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
링크
글 보관함