fork download
  1. #include <stdio.h>
  2.  
  3. #if ! defined(__cplusplus)
  4. #error "not compiled with C++"
  5. #endif
  6.  
  7. extern "C" void logMsg(const char*fmt, int n1,int n2=0,int n3=0,int n4=0,int n5=0,int n6=0);
  8.  
  9. extern "C" void logMsg(const char*fmt, int n1,int n2,int n3,int n4,int n5,int n6)
  10. {
  11. printf(fmt,n1,n2,n3,n4,n5,n6);
  12. }
  13.  
  14. int main() {
  15. logMsg("%d\n", 1);
  16. logMsg("%d,%d\n", 1,2);
  17. logMsg("%d,%d,%d\n", 1,2,3);
  18. logMsg("%d,%d,%d,%d\n", 1,2,3,4);
  19. logMsg("%d,%d,%d,%d,%d\n", 1,2,3,4,5);
  20. logMsg("%d,%d,%d,%d,%d,%d\n", 1,2,3,4,5,6);
  21.  
  22. printf("%d\n",__cplusplus);
  23. return 0;
  24. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
1
1,2
1,2,3
1,2,3,4
1,2,3,4,5
1,2,3,4,5,6
199711