fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Node
  5. {
  6. public:
  7. char character;
  8. };
  9. class Tree
  10. {
  11. public:
  12. Tree()
  13. {
  14.  
  15. }
  16. Node* nodes[26];
  17. };
  18. int main() {
  19. Tree* t = new Tree();
  20. t->nodes[0].character = 'a';
  21. //cout << "\"" << t->nodes[0]->character << "\"";
  22. }
Compilation error #stdin compilation error #stdout 0s 3468KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:20:14: error: request for member ‘character’ in ‘t->Tree::nodes[0]’, which is of pointer type ‘Node*’ (maybe you meant to use ‘->’ ?)
  t->nodes[0].character = 'a';
              ^
stdout
Standard output is empty