Hello, could someone be so kind as to give me a short tutorial on how to use a function that accepts multiples values and parameters using references. I need to create a function that accepts an int and a double and squares both values by using references. I'm not sure how to create a function that accepts multiple arguments let alone of different types. Thank you!
c++learner
0
Light Poster
Recommended Answers
Jump to Post>>I'm not sure how to create a function that accepts multiple arguments.
Its easy, its very same as a single argument function. Compare these 2 functions.
void one(int a){ /* do something with a */} void two(int a, int b){ /* do something with a and …
Jump to Post>>But another problem I have is that is has to accept an int type and also a double type
There are couple of ways to do this. It depends on what you know. Have you
heard of function overloading? Here is an example :void print(int …
Jump to PostWhy didn't you continue this thread?http://www.daniweb.com/forums/thread294268.html
All 12 Replies
mrnutty
761
Senior Poster
c++learner
0
Light Poster
mrnutty
761
Senior Poster
jonsca
1,059
Quantitative Phrenologist
Team Colleague
Featured Poster
c++learner
0
Light Poster
c++learner
0
Light Poster
jonsca
1,059
Quantitative Phrenologist
Team Colleague
Featured Poster
jonsca
1,059
Quantitative Phrenologist
Team Colleague
Featured Poster
c++learner
0
Light Poster
c++learner
0
Light Poster
jonsca
1,059
Quantitative Phrenologist
Team Colleague
Featured Poster
c++learner
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.