fork(3) download
  1. #include <stdio.h>
  2.  
  3. enum node_type {LEAF, NODE};
  4.  
  5. struct node {
  6. enum node_type type;
  7. };
  8.  
  9. int parse_tree( struct node* n ) {
  10. switch( n->type ) {
  11. case NODE: return 1;
  12. case LEAF: return 2;
  13. }
  14. }
  15.  
  16. int main() {
  17. struct node n;
  18. printf("%d", parse_tree(&n));
  19. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
2