티스토리 뷰
이 페이지를 작성한 이유는 각종 코딩 시험에서 input.txt로 입력이 주어질때 비주얼 스튜디오(visual studio)에서는
상단메뉴 디버그 -> 속성 -> 구성속성의 디버깅 -> 명령인수에 <input.txt >output.txt를 쓰면 되었다.
비주얼 스튜디오에서 입력으로 파일 들어가게 리다이렉션 설정하기 (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할때마다 해야하니 귀찮을 수도 있음
'컴퓨터 꿀팁' 카테고리의 다른 글
2019년 8월 삼성전자 SW level up 코스 후기 (0) | 2020.02.06 |
---|---|
GoogLeNet(inception), inception v3의 첫번째 convolution layer의 필터 시각화(Visualization of the first filters of GoogLeNet and inception v3) (0) | 2019.05.09 |
한성 컴퓨터 노트북 ssd 나사 등 각종 내부 나사 없을때, 분실 했을때. (0) | 2019.04.28 |
한성컴퓨터 xh57 7700ti 노트북 전압강하(전압 다이어트) (발열 완화) (0) | 2017.12.26 |
한성컴퓨터 xh57 7700ti nvme ssd달기 (분해) (0) | 2017.12.22 |