phizzalot 0 Newbie Poster

Hello Iam using xcode c++ cmd line to build a program that will
1. read all files in a directory
2. use the last 9 charcters in the Filename to Make a Directory with that name.
3. Move that file to the new directory.

My function works well with going to the directory and printing the files to the screen but Iam having trouble with selecting the last 4 charecters in the vector string (filename) and making a directory with that name.

getdir(dir,files);
    for (unsigned int i = 0;i < files.size();i++) {
        cout << files[i] << endl;
    }

The above code will print all files to the screen but iam thinking of adding an array and filling it with the 6 charceters that I want the new directory to be named.

getdir(dir,files);
#include <dir.h>
   
 for (unsigned int i = 0;i < files.size();i++) {
        datesize[a,0] = files[i,9];
        datesize[a,1] = files[i,10];
        datesize[a,2] = files[i,11];
        datesize[a,3] = files[i,12];
        datesize[a,4] = files[i,13];
        datesize[a,5] = files[i,14];
     
        int n=mkdir("datesize[a]");
    }

This is my idea any help would be appreciated, I haven't got to the move file part yet.