Aug 1, 2012 at 8:02am UTC
Hello,
I am completely lost and was hoping someone might be willing to help me.
The part of the program I need to understand is...
i am supposed to create a program in c++ that uses separate functions in separate files.
There are to be 5 files with 5 functions
other than main the functions are to be named the same name
the first function is to have 3 parameters ALL type INT
1. a letter
2. the number of colums
3. the number of rows
so it would be
1st Function
int thisFunction('A',5,2)
AAAAA //the first parameter is char second columns which is 5
AAAAA //the third is the rows which is 2
2nd function is to have 2 parameters
so everything the first function had - the rows
3rd Function is to have 1 parameter
so just the letter
and the 4th no parameters which will return nothing
The user is then to input the parameters
So the user would input
c
2
2
and it would print
ccc
ccc
I am very confused. I understand the idea behind function overloading but dont know how to make the user input the parameters.
If anyone has the time to help I would greatly appreciate it.
Im not lazy and am more than willing to do my own work, i just dont know how.
Aug 1, 2012 at 9:38am UTC
I think the user in this case means the programmer who uses your functions. The user input the parameters by passing arguments to the function.
Aug 1, 2012 at 11:30am UTC
Maybe in this case it is better to have one function with default arguments provided that all functions mentionad by you do the same task and there are suitable values that can be used as default arguments.
For exanple
void func( char = '\0', int = 0, int = 0 );