Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   'max_element()' without <algorithm> (Dev-C++) (http://www.programmingforums.org/showthread.php?t=7587)

Cache Dec 15th, 2005 2:04 PM

'max_element()' without <algorithm> (Dev-C++)
 
Hi,

I'm using Dev-C++ and have noticed that I can use some functions such as: ''max_element()' and 'tolower()' -- without including their header file 'algorithm', 'cctype' ect.

Can anyone explain the reason for this?

nnxion Dec 15th, 2005 2:09 PM

It's assuming you are using the standard library, which you are.

Cache Dec 15th, 2005 2:14 PM

Then should I still #include these header files?

zirener Dec 15th, 2005 2:23 PM

Yes, you should. This is compiler-dependent, if I'm not mistaken.

DaWei Dec 15th, 2005 2:33 PM

Some declarations are present in more than one header file. Some header files are included in other header files. The documentation for the function will normally give you all the information you need. Zirener is correct -- you should not rely on non-standard defaults.

Cache Dec 16th, 2005 8:27 PM

OK, thanks a lot guys.


All times are GMT -5. The time now is 2:08 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC