Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent - distinguish between istream and ifstream 1

Status
Not open for further replies.

Sedai

Programmer
Mar 4, 2001
158
US
is there a way to check if an object is of type istream or ifstream.
sizeof() doesnt work as both are size 64.
are there any methods (member functions) used for checking ?
ANY ideas are welcome.
thank you! Avendeval


 
ifstream ifs;

if (typeid(ifs)==typeid(ifstream)) cout << &quot;is ifstream&quot;; :) Hope that this helped! ;-)
 
it didn't work in my case, but it's something ill definitely use some other time
thanks!
Avendeval


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top