+ 2

What is difference between runtime argument and constant argument?

how to use constant argument within the class definition

21st Feb 2017, 2:28 AM
meet
meet - avatar
1 Réponse
0
A constant argument cannot be modified by the function or method that it's passed to. For example: void function(const int var) { var = 5; //not allowed x = var; //allowed } Passing a const argument implies you don't want that argument to change accidentally in your function. Run-time arguments are typically found in: main(int argc, char** argv) for C++. They are also known as command-line arguments which specify configuration information when your program is launched e.g. program name, its dependencies etc. argc corresponds to the number of arguments passed into the program from the command-line, whereas argv is a listing of all the arguments.
17th Mar 2017, 8:02 AM
Adder
Adder - avatar