#include<stdio.h> #include<conio.h>
void main() { int i; char str[50]; clrscr(); printf(“Enter a string:”); gets(str);
for(i=0;str[i]!=’’;++i); printf(“Lenth of string is %d”,i); getch(); }
#include<stdio.h> #include<conio.h>
void main() { int i; char str[50]; clrscr(); printf(“Enter a string :”); gets(str);
for(i=0;str[i]!=’’;++i); printf(“ Lenth of string is %d”,i); getch(); }
翻译自: https://www.thecrazyprogrammer.com/2013/05/c-program-to-find-length-of-string.html
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。