fork download
  1. #pragma once
  2.  
  3. extern "C"
  4. {
  5. #pragma function(memset)
  6. void *memset(void *dest, int c, size_t count)
  7. {
  8. char *bytes = (char *)dest;
  9. while (count--)
  10. {
  11. *bytes++ = (char)c;
  12. }
  13. return dest;
  14. }
  15.  
  16. #pragma function(memcpy)
  17. void *memcpy(void *dest, const void *src, size_t count)
  18. {
  19. char *dest8 = (char *)dest;
  20. const char *src8 = (const char *)src;
  21. while (count--)
  22. {
  23. *dest8++ = *src8++;
  24. }
  25. return dest;
  26. }
  27. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:9: warning: #pragma once in main file
 #pragma once
         ^
prog.cpp:6:34: error: 'size_t' has not been declared
  void *memset(void *dest, int c, size_t count)
                                  ^
prog.cpp:17:44: error: 'size_t' has not been declared
  void *memcpy(void *dest, const void *src, size_t count)
                                            ^
stdout
Standard output is empty