I am trying to open multiple text files using fstream in a class float_seq object that i have created but i don't know how to close the file in order to open the next one. definitions in class and main code shown below.
Stating fstream fin twice, the compiler wants to create a variable that still exists. It cannot do that. Once you have given a name to a variable you cannot "empty" the name and declare it again. fin can be used again but not as declaration.
You can do this instead of declaring a new variable:
1 2 3 4 5
fstream fin("filter1.txt");
fin>> signal;
fin.close();
fin.open("filter2.txt");//I don't know whether fin("filter2.txt") would work
fin>> signal2;