29.2k views
5 votes
Suppose a reference variable of type file called myfile has already been declared . create an object of type file with the initial file name input.dat and assign it to the reference variable myfile.

User Cozek
by
7.5k points

1 Answer

2 votes
If the variable myfile has been declared, then the way to create an object with a file name of input.dat is to declare the variable input.dat as well. Next, the variable can then be assigned to the data that is manually inputted. Finally, the reference variable myfile can be equated to the input.dat variable.
User Facetoe
by
6.4k points