473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Why do several functions in iostream and fstream have identical name?

1. Why do several functions in iostream and fstream have identical name?

2.When it is suitable/advantages to reuse functions name?
Jan 10 '11 #1
1 4990
horace1
1,510 Expert 1GB
it is called function overloading where the same function can vary in the types and number of parameters, e.g. get() in isteam
http://www.cplusplus.com/reference/i...m/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/
Jan 10 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Xif | last post by:
Hello Everyone! Here's a problem with relative imports: Suppose I have a package called some_package (in a separate directory included in the PYTHONPATH, with an __init__.py file etc.) This...
0
by: Marc Schellens | last post by:
fstream.open( name, mode) fails fstream.fail() returns true. How can I find out what went wrong? (ie. file does not exist for reading, permissions...) thanks, marc
3
by: Xiangliang Meng | last post by:
Hi, all class Clock { Clock() { Time_m = 0;} void setTime(unsigned int time = 0) { Time_m = time; } unsigned int getTime() const
1
by: Minh | last post by:
I've just installed VS.NET 2003 on my Athlon XP 1800+. However I couldn't get any project with STL includes to compile even if I create a new empty project (and added #include <string>). It gave me...
5
by: Jim Strathmeyer | last post by:
So I'm having some weird problems with file output. If I try to boil this problem down to a small, simple program to just show what problems I'm having, I can't get the same problematic behavior. I...
5
by: zzppallas | last post by:
I have interface A and interface B decalared as follow: class A { public: virtual void OnError(std::string reson) = 0; }; class B { public:
3
by: Juha Nieminen | last post by:
It occurred to me while developing an application: What happens if two (completely independent) base classes have the exact same virtual function, and then a derived class is derived from both,...
7
by: Stef Mientki | last post by:
hello, For a simulation at different levels, I need different functions with the same name. Is that possible ? I can realize it with a simple switch within each function, but that makes the...
2
by: metafizzical | last post by:
Hi, I have an object that contains the main data for my script. For example: function Invoice() { this.name="bob" this.email="abc@example.com" } I'm trying to access and edit the...
1
by: lanser | last post by:
Hi Gurus, I have two libraries, called libA and libB and I will create a driver placed between them, look like following: libA | driver | libB There is a function reference in libA, named...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.