Hello,
My problem is, I have data files named data001 -> data999, I need to somehow input a number n from the console and open files from data001 to datan using an std::ifstream fin to work on them one by one. What I'm thinking of right now is having a string s = "data" and running a loop from 1 to n. For example when the loop is at 1 I'll have s += "001"; and fin.open(s); but that takes too many if conditions and making the code looks a bit ugly. Is there a better approach for me?
Thank you for your help and sorry if I'm not clear enough (I'm not an English speaker), if you want to ask something that would help you help me, please do.