[function] strlen()

duckkuri·2020년 10월 6일
0

libc_functions

목록 보기
9/22

[function] strlen()

라이브러리 : libc

헤더 : string.h

  • 문자열의 길이를 찾음
  • strlen()함수는 문자열의 길이를 계산한다.

형식

strncmp(const char *s1);

const char s1 : 대상 문자열
const : 불변의 변수*

리턴값

int 형 데이터로 리턴

strlen()함수는 NULL 문자로 끝나기 전까지의 문자수를 반환한다.

사용 예제

printf("result : %d\n", strlen("hello"));	// 5

참고 사이트
https://www.freebsd.org/cgi/man.cgi?query=index&sektion=3&apropos=0&manpath=fre

profile
😤 Today I Learned

0개의 댓글