STRING ALGORITHMS
Print this page
 
ALGORITHM FOR StringLength  

We assume that the given string STR is terminated by special symbol '\o'.

  1. length = 0, i=0;                                        //Indentity starts from '0'.
  2. while STR[i] != '\0'                                //In C '\o' is used as end-of-string markes.

    i++;
    length=i;

  3. return length
 
Prev