#include <stdio.h>
#include <string.h>
int main(void)
{
int len;
char s[] = "today";
len = strlen(s);
printf("\"%s\" は %d 文字\n", s, len);
printf("\"%s\" は %d 文字\n", "hello world", strlen("hello world"));
return 0;
}
【実行結果】
"today" は 5 文字 "hello world" は 11 文字 |
▼戻る▼
「初心者のためのポイント学習C言語」 Copyright(c) 2000-2004 TOMOJI All Rights Reserved