반응형
Command line argument
1. main() with command line arguments.
ex1.c:
int main(int *x, char *y[]){
.............
}
The system will pass
x: command line arguments의 개수 (아래 예제에서 3개가 아니라 4개임에 유의)y: command line argument
For example,
$ ./ex1 x1 x2 x3
will pass 4 command line arguments: ./ex1, x1, x2, x3.
Therefore, the system will pass
x<-- 4 (number of command line arguments)y[0]<--./ex1(first command line argument)y[1]<--x1(second command line argument)y[2]<--x2(third command line argument)y[3]<--x3(fourth command line argument)
추가적인 예제 및 실습 문제들을 확인하고 싶으시면 아래 링크를 클릭해주세요 :)
GitHub - oneonlee/Computer-Science: Introduction to Computer Science
Introduction to Computer Science. Contribute to oneonlee/Computer-Science development by creating an account on GitHub.
github.com
반응형
'Development > Linux' 카테고리의 다른 글
| [Linux] exec 함수 알고리즘, execve 함수 예제 (0) | 2022.05.30 |
|---|---|
| [Linux] 시스템 호출 관련 프로세스 관리 - fork, exec, wait, getpid 등 (0) | 2022.04.17 |
| [Linux] non-text file 및 wav 파일 다루기 (0) | 2022.04.17 |
| [Linux] 원격 파일 전송 (업로드/다운로드) (0) | 2022.04.17 |
| [Linux] open, read, write - C/C++ 시스템 호출 (0) | 2022.04.17 |