Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
battle_c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
이장원
battle_c
Commits
b4097fe4
Commit
b4097fe4
authored
4 years ago
by
이장원
Browse files
Options
Downloads
Patches
Plain Diff
8.3
parent
3ba3fab0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
8.3/README.md
+55
-0
55 additions, 0 deletions
8.3/README.md
with
55 additions
and
0 deletions
8.3/README.md
0 → 100644
+
55
−
0
View file @
b4097fe4
# printf
`int printf(const char *format, ...)`
printf 함수는 매개변수를 format에 따라서 출력해주는 함수다.
`int fprintf(FILE *stream, const char *format, ...)`
printf 함수는 실행될 때 내부에서 fprintf 함수로 바뀌어서 실행된다.
```
printf("Hello World")
fprintf(stdout, "Hello World")
```
printf 함수가 fprintf 함수로 바뀔 때 stream에 stdout이 들어가게 되고 두 함수는 완전히 같은 역할을 한다.
# stdio.h
standard input output library의 줄임말로 표준 입출력과 관련된 함수, 매크로 등이 포함된 헤더 파일이다.
## stream
*
stdin
표준 입력 스트림(키보드)를 참조하는 FILE에 대한 포인터
*
stdout
표준 출력 스트림(스크린)를 참조하는 FILE에 대한 포인터
*
stderr
표준 오류 스트림(스크린)를 참조하는 FILE에 대한 포인터
# man
`man <command | function | header file | ...>`
manual의 줄임말로 명령어나 함수, 헤더 파일 등에 대한 사용법을 알려주는 명령어다.
# redirection
redirection이란 스트림의 흐름을 바꿔주는 것이다. redirection을 이용해 프로세스의 스트림을 콘솔이 아닌 파일을 사용할 수 있다.
*
\>
file
표준 출력을 파일로 redirection한다. 파일이 없으면 새로 만들고, 파일이 있으면 덮어쓴다.
```
$ ./test > output_data
```
*
\>
> file
표준 출력을 파일로 redirection한다. 파일이 없으면 새로 만들고, 파일이 있으면 파일의 끝에 덧붙인다.
```
$ ./test >> output_data
```
*
< file
파일로부터 표준 입력을 받도록 redirection한다.
```
$ ./test < intput_data
```
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment