C++ Arguments
im really not understanding what an argument is, can someone please help me to understand..
thanks in advance
Consider the following function, which adds two numbers together.
"number1" and "number2" are the arguments of the "add" function. When we call "add" we "pass" values to that function in it's arguments:
Does that help?
int add(int number1, int number2){ return number1 + number 2;}
"number1" and "number2" are the arguments of the "add" function. When we call "add" we "pass" values to that function in it's arguments:
int one = 1;int two = 2;// here we pass the variables "one" and "two" as arguments to the add functionint sum = add(one,two);
Does that help?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement