fork download
  1. #include <stdio.h>
  2.  
  3. typedef enum {tarasB = 0, superhackkiller1997, other_shit} users_t;
  4.  
  5. const char * users[] = {"tarasB", "superhackkiller1997", "other_shit"};
  6.  
  7. typedef struct say_struct_t {
  8. users_t usr;
  9. void operator () (const char * str) {
  10. fprintf(stderr, "%s: %s\n", users[usr], str);
  11. }
  12. } *say_struct_p;
  13.  
  14. say_struct_t bind(users_t usr) {
  15. say_struct_p p = new say_struct_t;
  16. p->usr = usr;
  17. return *p;
  18. }
  19.  
  20. int main(void) {
  21. bind(tarasB)("shit");
  22. bind(superhackkiller1997)("i'm god");
  23. bind(other_shit)("ko-ko-ko");
  24. return 0;
  25. }
Success #stdin #stdout #stderr 0s 2980KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
tarasB: shit
superhackkiller1997: i'm god
other_shit: ko-ko-ko