So we're doing data input/output right now by ourselves, cause the professor refuses to treat these things in class...
When you have this for example
ifstream inStream;
inStream.open(sometextfile.txt);
First line you open a stream, then it reads the values in the file, all is good and dandy.
However, inStream holds all the values in the text I am assuming, so therefore I can do this:
int Array[] = (inStream);
If this is possible, I can make a pointer to this array and do all sorts of things to it, like bubblesort it and stuff, right?
How would I go around declaring the size of the array without knowing the amount of elements in the text file? I'm not exactly sure how inStream reads and holds the information so i'm at a loss here.
Thanks to anyone who replies
Bookmarks