Devi usare un vector globale e sostituire il cout in callback con vector.push_back