size_t strlen(const char *str);
Parameter:
str: chuỗi kí tự đầu vào
Remark:
Hàm strlen( ) tính độ dài chuỗi kí tự.
- Hàm trả về độ dài chuỗi kí tự (không tính kí tự NULL)
Ví dụ:
#include "stdio.h" #include "conio.h" #include "string.h" void main( void ) { char str[] = "high school"; printf("\nLength of '%s' is: %d", str, strlen(str)); getch(); }
Kết quả:
Leave a Reply
You must be logged in to post a comment.