My professor is very smart, but expects complete noobs, like me, to just know how to program C ++ . I do not understand how the fstream
function works.
I will have a data file with three columns of data. I will need to determine with a logarithm whether each row of data will be a circle, rectangle or triangle - this part is simple. I do not understand how the fstream
function works.
I think that i:
#include < fstream >
then should i declare my file file?
ifstream Holes;
then I open it:
ifstream.open Holes;
I do not know what the correct syntax is, and I cannot find a simple tutorial. Everything seems more advanced than my skills can handle.
Also, as soon as I read in the data file, what is the correct syntax for placing data in arrays?
I just declare an array, for example. T[N]
and cin
the fstream
Holes
object into it?
source share