내 모듈에서 "사용하기 쉬운"출력 리디렉션을 작성하려고했습니다. 어떤 파일과 stdin
사이에 fprintf
의 출력을 변경한다고 가정합니다. `stdin` 매크로 선언을 어디에서 찾을 수 있습니까?
void _connection(char mode) { /* pass 'v' as an argument to set verbous mode*/
FILE *stream
if (mode == 'v')
fopen(stream, "stdin location?");
else
fopen(stream, "../stream");
fprintf(stream, "Connecting to the queue...");
...
fprintf(stream, "Some detail information...");
---
내 시스템을 검색 내가 어떤 표준 입력 선언을 찾을 수 없습니다 있었다 : 그래서 내가 좋아하는 뭔가에 대해 생각하고. 내 시스템에서
stdio.h
소스 파일이이 매크로를 사용하고 있지만 가져올 수 없습니다. 이 파일에는
stdin
이라는 입력 파일이나 매크로가 없습니다.
@EugeneSh. 달려있어. – iBug
@iBug 예, 매크로 일 수 있습니다. –