Sunday, 19 February 2017

How would you find the length of each string in the program .


How would you find the length of each string in the program?





void main()

{

  char *str[] = {“Frogs”, “Do”, “Not”, “They”, “Croak!”};

  int i;


       for(i=0; i<=4; i++)

          printf(“\n %s  %d”, str[i], strlen(str[i]));

}




0 comments:

Post a Comment