Accessing vector from testApp class in another class

Hi,

I have created a class Cars in which I have a draw function which I want to be able to access a vector from the testApp class. I am trying to access it like this but am getting errors. What should I be doing?

testApp.cpp
void Cars::draw() {

float time = ofGetElapsedTimef();
int n = testApp::imgSeqs[carNo].size(); // WORK OUT HOW MANY FRAMES IN THAT VECTOR THERE IS
float duration = n / 12.0; // 1/6
float pos = fmodf( time, duration ); // maps time as a position on a scale of 1/6 seconds
int i = int( pos / duration * n );
testApp::imgSeqs[carNo][i].draw(cur);

}

void testApp::setup() {

// LOAD CARS DIRECTORY

ofDirectory dir;
int n = dir.listDir("Cars");
imgSeqs.resize(n);
cout << dir.size() << endl;

// GO THROUGH EACH FOLDER IN CARS AND LOAD EACH INDIVDIUAL FOLDER & IMAGES INTO A VECTOR

for (int x =0; x < n; x++) {
    
    // GET PATH OF INNER DIRECTORY
    
    string fileName = dir.getPath(x);
    cout << fileName << endl;
    
    //LOAD PATH INTO NEW DIRECTORY OBJECT
    
    ofDirectory inDir;
    int y = inDir.listDir(fileName);
    imgSeqs[x].resize(y);
    cout << y << endl;
    
    // LOOP THROUGH EACH FILE IN THE FOLDER AND LOAD THE IMAGE INTO A VECTOR
    
    for ( int p =0; p < y ; p++) {
        
        string fileName2 = inDir.getPath(p);
        ofLoadImage(imgSeqs[x][p], fileName2);
        cout << "just loaded " << fileName2 << endl;
    }
    
    
    
}

you cannot access elements in testApp like that. there’s a function that returns a pointer to your application: ofGetAppPtr() but it’s not a good practice anyway, what i would do is move the contents of imgSeqs to each Car object so each object knows it’s imgSeqs which will make your code simpler too by not having a vector of vectors