Advertisement
minh_tran_782

NewFunc

Mar 29th, 2022 (edited)
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. void addPath(char* path, char* child, char* childpath)
  2. {
  3.   int size_path = length(path);
  4. for (int i = 0; i < size_path; i++) childpath[i] = path[i];
  5. childpath[size_path] = '/';
  6. int length_lastMod = length(child);
  7. int childPathSize = size_path + length_lastMod + 1;
  8. int cnt = 0;  
  9. for (int i = size_path + 1; i  < childPathSize; i++)
  10. {
  11.     childpath[i] = child[cnt];  
  12.     ++cnt;
  13.     if (cnt == length_lastMod + 1) break;
  14. }
  15. childpath[childPathSize] = '\0';
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement