+ 1
What is the problem of this program for give me the length of this string ch
#include<stdio.h> #include<string.h> int main(){ char *ch[50]; int i ; printf ("give me string"); gets(ch); while (*ch!='\0') { i=i+1; return i ; } return 0; }
1 Réponse
+ 1
Im not an expert but first of all u have a return key word that will exit the loop and if you omit the return i u will have an infinite loop condition because u dont iterate over the string ch