전체 글174 ft_calloc calloc? #include void *calloc(size_t nmemb, size_t size); Linux manpage description : The calloc() function allocates memory for an array of nmemb elements of size bytes each and returns a pointer to the allocated memory. The memory is set to zero. If nmemb or size is 0, then calloc() returns either NULL, or a unique pointer value that can later be successfully passed to free(). If the multiplic.. 2023. 2. 16. ft_atoi atoi? #include int atoi(const char *nptr); Linux manpage description : The atoi() function converts the initial portion of the string pointed to by nptr to int. The behavior is the same as strtol(nptr, NULL, 10); except that atoi() does not detect errors. 해석 및 부연설명 : 포인터 nptr이 가리키는 문자열을 int로 변환하여 반환한다. ex) charstr[] = "-1535abcd"; printf("%d\n", atoi(str)); 코드 실행 결과 -1535 '-'부호가 적용되고, int로 표현할 수.. 2023. 2. 16. ft_strncmp strncmp? #include int strncmp(const char *s1, const char *s2, size_t n); Linux manpage description : The strcmp() function compares the two strings s1 and s2. The locale is not taken into account (for a locale-aware comparison, see strcoll(3)). It returns an integer less than, equal to, or greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2. The strnc.. 2023. 2. 16. ft_strlcpy strlcpy? #include size_t strlcpy(char *dst, const char *src, size_t size); Linux manpage description : The strlcpy() function copies up to size - 1 characters from the NUL-terminated string src to dst, NUL-terminating the result. The strlcpy() and strlcat() functions return the total length of the string they tried to create. For strlcpy() that means the length of src. 해석 및 부연설명 : memcpy 함수에서 봤던.. 2023. 2. 16. 이전 1 ··· 39 40 41 42 43 44 다음