Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Member List
Calendar
Today's Posts
Home
Forum
Topic
C
Why do several functions in iostream and fstream have identical name?
Why do several functions in iostream and fstream have identical name?
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
Fatihah
New Member
Join Date:
Jan 2011
Posts:
1
#1
Why do several functions in iostream and fstream have identical name?
Jan 10 '11, 10:39 AM
1. Why do several functions in iostream and fstream have identical name?
2.When it is suitable/advantages to reuse functions name?
horace1
Recognized Expert
Top Contributor
Join Date:
Nov 2006
Posts:
1510
#2
Jan 10 '11, 11:07 AM
it is called function overloading where the same function can vary in the types and number of parameters, e.g. get() in isteam
cplusplus.com - ERROR 404 Not Found
http://www.cplusplus.com/reference/iostream/istream/get/
when the function is called the compiler looks at the parameters and works out which version to call
for an introduction to function overloading see the tutorial
http://www.cplusplus.com/doc/tutorial/functions2/
Comment
Post
Cancel
Previous
template
Next
Working...
OK
OK
Cancel
👍
👎
☕
Comment