Advertisement
dllbridge

Untitled

Jun 25th, 2020
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. ////////////////////////////////////////////////////
  2. int PackText(char *sz_1, char  *sz_2)             //
  3. {
  4.    
  5.     int n = 0,
  6.         i = 0,
  7.      flag = 0;
  8.    
  9.     while(sz_2[n]) {
  10.        if(sz_2[n] == ' ')
  11.        {   
  12.               if( flag) {      n++;  continue; }
  13.               sz_1[i++] = sz_2[n++]; flag = 1;     
  14.        }else{ sz_1[i++] = sz_2[n++]; flag = 0; }
  15.     }
  16.    
  17.     sz_1[i] = 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement