fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. unsigned char digit[] = {0, 1, 2, 3, 4, 5, 6, 7};
  5. printf("Before:\n");
  6. for (int i = 0 ; i != 8 ; i++) {
  7. printf("%d ", digit[i]);
  8. }
  9. printf("\nAfter:\n");
  10. memcpy(&digit[4], (unsigned char []) {0, 9, 17, 0}, 4);
  11. for (int i = 0 ; i != 8 ; i++) {
  12. printf("%d ", digit[i]);
  13. }
  14. printf("\n");
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
Before:
0 1 2 3 4 5 6 7 
After:
0 1 2 3 0 9 17 0