| kndmrl (6) | |
|
I have to write a function which reads from a file and allocate it . if it is binary file open for binary or if it is text file function must open it in that way my question is void readPlayerInfosFromFile(fstream *file , string fileType ) when I declare that function I don't understand meaning of fstream *file What is the function of this parameter fstream * file | |
|
|
|
| strongdrink (456) | |
|
You used it as a function parameter before you knew what it does? O_o ... wat. Read the tutorial on file I/O http://cplusplus.com/doc/tutorial/files/ | |
|
Last edited on
|
|
| kndmrl (6) | |
| But there is no information about how to use streams as a parameter of function ? | |
|
|
|
| SirSen (17) | |||||
use a char, it works as well. For example:
Edit: The following code is a code that opens files and outputs the content:
| |||||
|
Last edited on
|
|||||