+ 1
Function & Parameter
What is the main difference between function and parameter in c++ ??
4 odpowiedzi
+ 1
parameters are conatined in a function. function executes a certain task using the parameters provided.
+ 1
and how parameter is different from argument ?
0
A function is basically a series of code statements that you can reference by name. A parameter is information that you can send to a function to alter or determine its output. For example:
float getShippingCost(float weight, float price);
This function would accept the parameters (arguments) of weight and price. The weight and price can then be used by the function to calculate the correct shipping cost. To get the shipping cost for a specific item, you could say:
float shipping = getShippingCost(13.0f, 1.39f);
0
parameters and arguments mean the same thing.