֪ Ŀ Lib Ƶ iProcess γ ֤ ѯ Modeler   Code  
Ա   
Ҫ
 
 

CԽ̳
CVSװ
CԵһ
CԳִ
Cprintf()scanf()
C
CԹؼ
C
CԿ
Cif-else
Cswitch
Cdo-whileѭ
Cwhileѭ
Cforѭ
Cbreak
Ccontinue
Cgoto
Cֵͨú
CԵݹ
CԴ洢
C
C
CԶά
CԽ鴫ݸ
Cָָ
Cgets()puts()
Cstrlen()
Cstrcpy()
Cstrcat()
Cstrcmp()
Cstrrev()
Cstrlwr()
Cstrupr()
CԽṹ
CԽṹ
CԽṹǶ
C
ļ
Cfprintf()fscanf()
Cfputc()fgetc()
Cfputs()fgets()
Cfseek()
Crewind()
Cftell()
Ԥ
CԤָ
C#includeָ
C#defineָ
C#undefָ
C#ifdefָ
C#ifndefָ
C#ifָ
C#errorָ
C#pragmaָ
 
 

Cstrlen()
148
2  
 

strlen()ظַijȣַ'\0'

ʹʾ

һԴļstring_strlen.cʾ -

#include <stdio.h>
void main()
{
char ch[20]={'u', 'm', 'l', '.', 'o', 'r', 'g', '.', 'c', 'n', '\0'};
char doname[]="uml.org.cn";
printf("Length of string is: %d",strlen(ch));
printf("Length of doname is: %d",strlen(doname));
}

ִʾ룬õ½ -

Length of string is: 10
Length of doname is: 14

ԿһĽΪ10Ϊ '\0'ڡ

 


Ծ֧ǵĹҵ

10Ԫ 50Ԫ





֤룺 ֤,?ˢ֤



148
2