Hi guys.
Anyone know how to read data from notepad or other .txt files without using the #include <fstream> header??
I'm supposed to read a data from a notepad file, but i only allowed to use #include <iostream>
Thanks. :)
Also notice that iostream is actually one of the base classes for fstream. I would think this problem would require you to write your own definition of fstream using the iostream library.
thanks for the reference. but i'm still not too clear about it.
sorry about that. i'm a begginer in this c++.
can you give me one example? just a simple one. thanks :)
Actually it's pretty simple. Your program may read text from the standard input (std::cin). You only need to redirect this standard input to a file when executing the program. For example, under Windows:
thanks for that, Abramus.
but the problem is that method haven't been taught.
and my teacher don't allow me to use the method which haven't taught by him.
is there another way? another simpe one.
hmm. let me show you the header file if you can find out another solution. thanks. :)