I have a few files named like so: file1
, file2
, file3
, etc.
I have a function:
load(const char *file)
which I would call like so load(file1)
, load(file2)
, etc.
I am trying do this a bit more dynamically, based on the number of files imported.
So if I have more than 1 file do something like this:
if (NUM_OF_FILES > 1) {
for (int i = 2; i <= NUM_OF_FILES; i++) {
load("file" + i);
}
}
However, this is not working.
Is there a way of doing this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…