(Week 2) Arrays

김형민·2023년 2월 11일
0

CS50x 2023

목록 보기
1/1
post-thumbnail

Lecture 2

Four steps of compiling
1. preprocessing
2. compiling
3. assembling
4. linking

  1. preprocessing
    find "#include" and copy & paste the contents to use

  2. compiling
    source code -> assembly code

  3. assembling
    assembly code -> binary machine code

  4. linking
    combines everyting together (e.g. hello.c + cs50.h + stdio.h)



Lab2: Scrabble

strlen() --> 문자 길이
isupper() / islower() --> 대문자 / 소문자 판별 boolean



Problem Set 2

Readability

#include <math.h> --> round 사용
#include <string.h> --> strlen 사용
#include <ctype.h> --> isupper / islower 사용
float와 int 사용 시 자료형(소수점) 구분 확실히!
if(text[i] == ' ') --> 같은 경우 표시 시 =(x), ==(o) //character는 " "(x), ' ' (o)


터미널 명령어

mkdir 폴더명 --> 디렉토리(폴더) 생성
cd 이동경로 -->이동경로로 디렉토리 이동
cd .. --> 현재 폴더의 상위폴더로 이동
touch 파일명.확장자 --> 파일 생성 ex) touch newfile.html
ls --> 폴더 내에 있는 파일들 출력
code . --> 코드에디터 실행(VS code) //.은 코드에디터에서 현재 위치의 폴더를 열겠다는 의미 //코드에디터마다 명령어는 다름


Bulbs

int decimal = s[i]
decimal /= 2;


Caesar (추후 작성)


Substitution (추후 작성)


Wordle50 (추후 작성)


끝으로

입학 원서를 준비하느라 약 6개월만에 다시 코드를 작성하려니 기본적인 코드도 단 하나도 기억이 나지 않는다.
이래서 코딩은 꾸준한 사람이 이긴다고 하나보다.
2022년 cs50 강의 기록이 2023년으로 업데이트 되며 코드들도 처음부터 다시 제출해야했다.
새로 배운다는 마음으로 열심히 공부해서 완강해보자!!!

profile
하고 싶은 것이 많은 인생. 기억하고 싶은 마음을 담은 블로그입니다 👀

0개의 댓글

관련 채용 정보