Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. size_t l=(size_t)  insertLength;
  2.     size_t m=(size_t)   strlen(src);
  3.     int i=0;
  4.     int j=0;
  5.     char * result1=(char *) malloc ((l+m)*sizeof(char));
  6.     char * result2;
  7.  
  8.     copyStringWithLength(result1,src,strlen(src)+1);
  9.  
  10.     for(j=insertPosition; j<insertPosition+insertLength; j++)
  11.    {
  12.        result1[j+insertLength]=result1[j];
  13.        result1[j]=toBeInserted[i];
  14.        i++;
  15.    }
  16.    result2=result1;
  17.  
  18.    return result2;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement