본문 바로가기

전체 글21

C02 null ('\0') https://gawoori.net/strlcat-3-%EB%A6%AC%EB%88%85%EC%8A%A4-%EB%A7%A4%EB%89%B4%EC%96%BC-%ED%8E%98%EC%9D%B4%EC%A7%80/ [ex00] strcpy함수란? string(=str), copy(cpy) char* strcpy(char* dest, const char* origin); origin에 있는 문자열 전체를 dest로 복사 하는 함수 char *ft_strcpy(char *dest, char *src) { int i; i = 0; while (src[i] != '\0') { dest[i] = src[i]; i++; } dest[i] = '\0'; return (dest); } [ex01] strn.. 2020. 6. 2.
C01 [ex00] #include void ft_ft(int *nbr); { *nbr = 42; } [ex01] #include void ft_ultimate_ft(int *********nbr) { *********nbr = 42 [ex02] void ft_swap(int *a, int *b) { int i; i = *a; *a = *b; *b = i; } [ex03] #include void ft_div_mod(int a, int b, int *div, int *mod) { *div = a / b; *mod = a % b; } [ex04] #include void ft_ultimate_div_mod(int *a, int*b) { int i; int j; i = *a / *b; *a = i; j = *a %.. 2020. 6. 1.
[linux] 자주쓰는 명령어 정리 ▶ 파일이동 mv file1 dir1/ ->file1을 dir1 로 이동 mv file1 file2 file3 dir1/ ->file1,file2,file3 을 dir1이동 ▶ 파일명 디렉토리명 변경 mv fileA file1 -> 파일fileA를 file1로 이름변경 mv dirA/ dir1/ -> 디렉토리dirA를 dir1로 이름변경 ▶ 파일복사 cp file1 file2 -> file1을 복사해서 file2이름으로 생성 ▶ 파일 압축 풀기 tar -xvf [파일명] ▶ 파일생성 touch [파일명] ▶ 권한 바꾸기 chmod 777 [파일명] drwx--x--x 형식으로 표시된 부분이 퍼미션 퍼미션은 10칸으로 표시 (1) 처음문자는 파일의 타입 ① d : 디렉토리 ② - : 표준파일 ③ l : 링.. 2020. 5. 31.
shell 명령어 파일 압축 풀기 : tar -xvf [파일명] 변수 선언 =를 이용해서 선언 $를 이용해서 사용 {} 는 parameter substitution $와 함께 감싼 부분에 변수를 대입해준다.(https://superuser.com/questions/935374/difference-between-and-in-shell-script) ""로 감싸서 사용하면 더 안전하다.(문자열에 공백도 포함해서 값을 이용할 수 있기 때문이다.) Ex) $ex -> "${ex}" =는 공백 없이 붙여써야한다. 지역변수에는 local을 붙인다. 2020. 5. 27.
day 03 shell01 ex01 print_groups 1. groups $FT_USER | sed 's/ /,/g' 2. id -Gn ★틀린 이유★ ★ tr -d '\n' : 개행 지우기 ★ 1. sed 사용법 sed (stream editor) : 그래픽 인터페이스가 없는 명령행 유틸리티임 그래서 많은 편집 작업을 일괄적! 으로 처리하기에 아주! 적합한 도구이다. sed는 파일을 한행씩 처리하고 현재 작업중인 라인을 패턴스페이스란 곳에 저장함 # 사용 문법 sed 'command' [filename] sed s/regular_expression/replacement_String/flags input_file ex) sed s/file_nmae/file_name/ > filename.txt ​ # sed 명령어들 d : 행 .. 2020. 5. 27.
day2 ex00 open . 해당경로 폴더 열기 06 git_ignore.sh 내생각 git status --ignored https://riptutorial.com/ko/git/example/19445/-gitignore%EA%B0%80-%EB%AC%B4%EC%8B%9C%ED%95%9C-%ED%8C%8C%EC%9D%BC-%EC%B0%BE%EA%B8%B0 Git - .gitignore가 무시한 파일 찾기 | git Tutorial git documentation: .gitignore가 무시한 파일 찾기 riptutorial.com ---> Shell Command 정리 https://www.daleseo.com/shell-command-ls/ ls 쉘 커맨드 사용법 Engineering Blog by Dale Seo w.. 2020. 5. 26.
day1 EX00 00: Z vim z (z파일 생성 및 vim으로 들어감) Z입력후 저장후 vim닫기 cat z 후 제대로 나오는지 확인 touch 빈 파이릉ㄹ 생성하고나 최종 수정시간을 변경할때 사ㅏ용하는 명렁어 01: testShell00 vim testShell00 40자 채우기 - 저장후 종료 ls -l 입력후 확인 chmod 사용해서 권한 바꾸기 tar -cf testShell00.tar testShell00 입력 날짜 바꾸는 방법 touch -t 202003042337 파일명 02 퍼미션 설정하기 drwx--x--x 형식으로 표시된 부분이 퍼미션 입니다. 퍼미션은 10칸으로 표시되며, 기본적으로 drwxrwxrwx 와 같은 형식을 가지고 있습니다. (1) 처음 문자는 파일의 타입을 나타냅니다. ① d : 디렉.. 2020. 5. 25.
day1 Rush- team project due to Sunday 11:42pm Terminal -> ssh-keygen ( create directory) /.ssh/id_rsa. /.ssh/id_rsa.pub Cat + keynote Man ; manual 매뉴얼 검색하는 법 / + 단어 Q 매뉴얼 종료 -f man : Ctrl + l : 다 지우기 Pwd : tell you where you are located in the filesystem ls : see the content of our directory ls -p : adding a slash to directories ls -l : listing directory ls -la : display hidden files mkdir : make dir.. 2020. 5. 25.
C언어프로그래밍 정리_1 1. 프로그래밍언어 인간과 컴퓨터의 대화에 사용되는 의사소통 수단 2. 컴파일러(compiler) 프로그래밍 언어로 작성딘 프로그램을 컴퓨터가 이해할 수 있도록 기계어로 번역해주는 번역기 → 어셈블러(assembler) 기호로 표현도니 어셈블리 코드를 기계어로 번역하는 번역기 →인터프리터(interpreter) 소스 프로그램을 한번에 기계어로 변환시키는 컴파일러와 달리 프로그램을 한단계씩 기계어로 해석하여 실행하는 '언어처리 프로그램' 3. 고급언어, 저급언어 인간이 이해하기 쉬운 언어에 가까울수록 고급언어(high-level language) : C언어 컴퓨터가 이해하기 쉬운 언어에 가까울수록 저급언어(low-level language) : 어셈블리 언어 4. C언어의 특징 논리적이며 구조적 하드웨어 .. 2020. 2. 27.