Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 15th, 2005, 2:04 PM   #1
Cache
Hobbyist
 
Join Date: Sep 2005
Posts: 259
Rep Power: 3 Cache is on a distinguished road
'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?
Cache is offline   Reply With Quote
Old Dec 15th, 2005, 2:09 PM   #2
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
It's assuming you are using the standard library, which you are.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Dec 15th, 2005, 2:14 PM   #3
Cache
Hobbyist
 
Join Date: Sep 2005
Posts: 259
Rep Power: 3 Cache is on a distinguished road
Then should I still #include these header files?
Cache is offline   Reply With Quote
Old Dec 15th, 2005, 2:23 PM   #4
zirener
Newbie
 
Join Date: Dec 2005
Location: Space, Tellus, Europe, Norway, Oslo
Posts: 23
Rep Power: 0 zirener is an unknown quantity at this point
Send a message via MSN to zirener
Yes, you should. This is compiler-dependent, if I'm not mistaken.
__________________
«Don't touch what you can't grab!»
zirener is offline   Reply With Quote
Old Dec 15th, 2005, 2:33 PM   #5
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Dec 16th, 2005, 8:27 PM   #6
Cache
Hobbyist
 
Join Date: Sep 2005
Posts: 259
Rep Power: 3 Cache is on a distinguished road
OK, thanks a lot guys.
Cache is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:59 AM.

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