일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- 구조체
- cout
- 함수
- iF
- for
- Double
- 42
- python
- vs코드 단축키
- docker
- float
- nginx
- Class
- C++
- phpmyadmin
- jupyter 단축키
- 동적할당
- 42cursus
- 2차원배열
- C언어
- While
- 42Seoul
- 포인터
- ft_server
- else if
- 자료형
- list
- 패킹
- 42서울
- libft
- Today
- Total
목록패킹 (2)
Developer
List 인덱싱 numbers = [4 ,3, 2, 2 , 4] numbers[3] #2 numbers[0] #4 numbers[-1] #4 슬라이싱 numbers[1,2,3,4,5,6,7] numbers[:3] # 1 2 3 numbers[::-1] # 7 6 5 4 3 2 1 numbers[:-1] # 1 2 3 4 5 6 리스트 연산 nums1 = [1, 3, 5, 6] nums2 = [4, 8, 9, 10] nums1 + nums2 #[1, 3, 5, 6, 4, 8, 9, 10] 1 is in nums1 # True nums1.extend([7,6,45]) # 리스트에 새로운 리스트 추가 nums1.append(4) # 리스트에 4추가 nums1.insert(3, 9) # 3번째 주소에 9추가 n..

CPU는 비트에 따라서 메모리 접근 단위가 다르다. 32비트의 컴퓨터는 32비트 단위로, 64비트의 컴퓨터는 64비트 단위로 접근한다. 대부분의 C언어 컴파일러는 CPU가 효율적으로 메모리에 접근할 수 있도록 구조체를 정렬해준다. 그럼 구조체 정렬이 무엇인지 알아보자. 구조체 정렬 #include typedef struct { //구조체 정의 char a; int b; }some; int main() { some c; //구조체 변수 선언 printf("멤버변수 a의 크기 :%d Byte\n", sizeof(c.a)); printf("멤버변수 b의 크기 :%d Byte\n", sizeof(c.b)); printf("구조체 변수 c의 크기 :%d Byte\n", sizeof(c)); return 0; ..