I have a class that i'm using for a trie
class Node {
public:
map<char,Node*> node;
bool flag = false;
};
int main(){
Node table;
for(auto x: table){}
return 0;
}
I'm trying to iterate through it's elements but I keep getting errors
I checked stack for solutions and tried to use the iterator map method :
error: 'class Node' has no member named 'begin'
for (it = table->begin(); it != table->end(); it++){
^~~~~
error: 'class Node' has no member named 'end'
for (it = table->begin(); it != table->end(); it++){
Also tried to use a for loop and got a similar error:
error: 'begin' was not declared in this scope
for(auto x: table){
^~~~
How can I iterate through the elements in another way or how can I fix these errors?