fork download
  1. #define YES 10
  2. #define NO 20
  3. #define SIZE 4
  4. using namespace std;
  5. #include <iostream>
  6.  
  7. struct Node
  8. {
  9. Node ** children;
  10. int childCount;
  11. char name[1];
  12. int empty;//YES or NO
  13. int sequence;
  14. double value;
  15. };
  16.  
  17. using namespace std;
  18.  
  19. bool isEmpty(Node ptr[SIZE][SIZE]) {
  20. for (int i = 0; i<SIZE; i++) {
  21. for (int j = 0; j < SIZE; j++) {
  22. if(ptr[i][j].empty == YES){
  23. return true;
  24. }
  25. }
  26. }
  27. return false;
  28. }
  29.  
  30. int main (int argc, const char * argv[])
  31. {
  32. Node tree[SIZE][SIZE];
  33. // some stuff
  34. if (isEmpty(tree)) {
  35. cout<<"this is empty\n";
  36. return 0;
  37. }
  38. return 0;
  39. }
Success #stdin #stdout 0.02s 2676KB
stdin
Standard input is empty
stdout
Standard output is empty