size_t
-
💡 [C/C++] size_t 자료형의 정의| 프로그래밍 분야/C 2021. 5. 3. 19:06
size_t 아래는 C99의 원문이다. size_t can store the maximum size of a theoretically possible object of any type. 즉, 32비트 환경에서는 32비트, 64비트 환경에서는 64비트의 unsigned 변수로써 다음과 같이 정의된 자료형이다. #ifdef _WIN64 // 64비트일 때 typedef unsigned__int64 size_t; // 8바이트 크기의 부호 없는 정수 자료형 #else // 64비트가 아닐 때 typedef unsigned int size_t; // 4바이트 크기의 부호 없는 정수 자료형 #endif size_t는 stdlib.h 헤더에 선언되어 있다. 시스템 환경에 따라 자료형의 size가 달라지는 점에 있어..
-
💡 [C언어] memset 함수 설명 및 자세한 예시| 프로그래밍 분야/C 2021. 5. 3. 17:37
💡 memset 함수의 정의 ✔︎ man memset NAME memset -- fill a byte string with a byte value LIBRARY Standard C Library (libc, -lc) SYNOPSIS #include void *memset(void *b, int c, size_t len); DESCRIPTION The memset() function writes len bytes of value c (converted to an unsigned char) to the string b. RETURN VALUES The memset() function returns its first argument. memset 함수는 string.h, memory.h 내장함수이다. 둘 중 ..