Is there a simple and elegant way to split an array from an index?
In my program I am getting a array of strings (argv), and I want to ignore the program name and some of its arguments, copying the rest in an array.
For example, the content of argv is {"program_name", "-o", "file1", "file2"}
I want to retrieve "file1" and "file2" in an array just to make an easy iteration over it.
// PSEUDO
char *files[argc - 2] = argv.split(2, argc - 2)
Any ideas?
argvis not usually avector. Please make a minimal reproducible exampleargvstarting from the desired index