samedi 22 juillet 2017

Invalid read of size 8 when printing stack

I have segfault (invalid read of size 8) when I try to print all elements of my stack like that:

for (std::stack<IOperand *> dump = stack_; !dump.empty(); dump.pop())
    std::cout << dump.top()->toString() << '\n';

for me it's exactly the same as printing a stack or stack

ps: my stack is not empty

Aucun commentaire:

Enregistrer un commentaire