fork download
  1. #include <stdio.h>
  2.  
  3. void copyString(char *source, char *destination) { // hàm sao chép chuỗi
  4. while (*source) {
  5. *destination = *source;
  6. source++;
  7. destination++;
  8. }
  9. *destination = '\0'; // Kết thúc chuỗi đích
  10. }
  11.  
  12. int main() {
  13. char source[] = "Hello, world!";
  14. char des[100];
  15. copyString(source, des);
  16.  
  17. printf("%s ", des);
  18. return 0;
  19. }
Success #stdin #stdout 0s 5272KB
stdin
Standard input is empty
stdout
Hello, world!