from my understanding, no.
this is because of the system of variable use. ifstream one is not a variable, and nor is ifstream two.
variables are something like int, float, etc. They can be added, subtracted and equaled, but not non-variables.
however, you could just write
note how i assigned ifsteam two to the same file as ifstream one.
just out of curiosity, why do you need to assign one file to two inputs? couldnt you just keep using ifstream one?
Iam trying to make the ifstream a global variable so basically my 'two' is declared in the header file and my 'one' opens the file and then I want to assign the 'one' two the 'two' so that other methods in the class can use the global variable. I am getting confused because you can do that kind of thing in Java, I don't know how to do it in C++.
then cant you just declare two to the same file that one contains? like what i did in the example? or why dont you just stay with a global variable for all of it and not even bother with the ifstream two?
alternatively, you could declare two in the header file, get one to reference the header file and just keep using two after that?
i still dont understand what you are trying to do..
the top code is your header file, no?
then where are you referencing your ifstream in the second block of code?