Recommanded Free YOUTUBE Lecture: <% selectedImage[1] %>

사용법

#include <string.h>

size_t strlen(const char *s);

설명

strlen 은 '\0' 을 만나기 전까지의 문자열 s 의 길이를 계산한다.

반환 값

s 에 있는 문자들의 수를 반환한다

예제

#include <string.h>
#include <stdio.h>

int main()
{
    char data[20] = "hello world\0...ok";  
    printf("%d\n", strlen(data));
}