String Algorithms
Print this page
 

STRING COPY

  • By string copy, we mean copying one string to another string character by character.
  • The size of the destination string should be greater than equal to the size of the source string.
 

Algorithm

  1. Set i=0
  2. while STR[i] != '\o'

    {
    STR2[i]=STR1[i];
    i =i+1;
    }

  3. Set STR2[i]='\o'
  4. Return STR2
 
 
Prev