fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void) {
  5. char buffer[3] = "abc";
  6. char buf_cpy[3];
  7.  
  8. memcpy(&buf_cpy, &buffer, 3);
  9.  
  10. /*
  11. printf("buffer :");
  12. for (int i = 0; i < 3; i++)
  13. {
  14. printf("%c", buffer[i]);
  15. }
  16. printf("\n");
  17.  
  18. printf("buf_cpy:");
  19. for (int i = 0; i < 3; i++)
  20. {
  21. printf("%c", buf_cpy[i]);
  22. }
  23. printf("\n");
  24. */
  25. printf("buffer :%02x\n", buffer[0]);
  26. printf("buffer :%02x\n", buffer[1]);
  27. printf("buffer :%02x\n", buffer[2]);
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
buffer :61
buffer :62
buffer :63