I ve read that iostream is a derived class of fstream ,so including the "fstream" header is all sufficient to perform console i/p and o/p(ie cin and cout) .this worked fine as long as I used Turbo C++ compiler but now I ve switched to Bloodshed Dev C++ compiler and it gives an error that cin is not recognized....it works fine only if I include both "iostream" and "fstream" in my program ....please help
sugantha 0 Newbie Poster
Recommended Answers
Jump to PostSome C++ compilers do not require IO imports to include cin/cout. The same is true with some C compilers and printf etc.
Jump to PostWell, according to this:
http://www.cppreference.com/cppio/index.html
cin, cout are defined in iostream.
And this will also help ypu understand what is going on.
http://www.cplusplus.com/ref/iostream/I hope it …
All 6 Replies
alpha_foobar 5 Junior Poster
Micko 2 Junior Poster
sugantha 0 Newbie Poster
Salem 5,265 Posting Sage
sugantha 0 Newbie Poster
Salem 5,265 Posting Sage
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.