The following example has a function with one argument (fname). Following is a simple example which checks if there is any argument supplied from the command line and take action accordingly −. What is void in C - C Programming - Tutorials, Examples ... Example: Suppose a Mult() function is needed to be defined to multiply two numbers. Syntax : getopt(int argc, char *const argv[], const char *optstring) optstring is simply a list of characters, each representing a single character option. An argument is a deliberate attempt to move beyond just making an assertion. We have created on the file named demo.txt. Syntax: int main(int argc, char *argv[]) Here argc counts the number of arguments on the command line and argv[ ] is a pointer array which holds pointers of type char which points to the arguments passed to the program. Usually, each argument must be specified in full (this is the case in the C programming language).Later languages (for example, in C++) allow the programmer to specify default arguments that always have a . std::bind is a Standard Function Objects that acts as a Functional Adaptor i.e. In these cases, C++ provides type checking only for the explicitly declared arguments. Callbacks in C. The callback is basically any executable code that is passed as an argument to other code, that is expected to call back or execute the argument at a given time. Command line arguments are passed to the main() method. When getopt returns -1, indicating no more options are present, the loop terminates. The conclusion is what the communicator wants his or her audience to accept, and the premises are the reasons for believing the conclusion to be true. We substitute the template arguments (actual data types) for the template parameters in the definition of the template class. The command line parsing rules used by Microsoft C/C++ code are Microsoft-specific. Explanation: In Example 2 the use of destructors is being made. Each of them representing a single character option. Logical arguments follow a specific procedure to present clear, coherent ideas. The default arguments are used during compilation of program. In this example, we are trying to create one file and read the name of the flower and color of the flower. The second mistake is that extra arguments are assigned as positional parameters to the shell process that's launched, not passed as arguments to the command. Conditional Operator Example. When the function is called, we pass along a first name, which is used inside the function to print the full name: If we like to add two numbers, we might write a code like this: int addNumbers( int nNumberOne, int nNumberTwo ) { return nNumberOne + nNumber If you are new to C programming, you should first understand how C array works. In this setup the argc will tell you the number of arguments passed to the program at launch, with argc getting a list of string pointers to those arguments. Parameterized Constructors: It is possible to pass arguments to constructors.Typically, these arguments help initialize an object when it is created. Destructors are created to remove the cache, or we can say history of a constructor. It is also possible to write functions by the programmer. argc (ARGument Count) denotes the number of arguments to be passed and. Note: The type of the arguments passed while calling the function must match with the corresponding parameters defined in the function declaration. Once a constructor is created and values are initialized to those constructors, it is the responsibility of the destructor to take care of the constructor's existence and remove its history automatically so that it does not create any impact on . Struct as Function Argument. It counts the file name as the first argument. If there is type mismatch between actual and formal arguments then the compiler will try to convert the type of actual arguments to formal arguments if it is legal, Otherwise, a garbage value will be passed to the formal argument. The most common function signature for main is int main (int argc, char *argv []). C++ function with parameters. Let's demonstrates this: Example 3: The arguments that we pass on to main() at the command prompt are called command line arguments. The getopt() function is a builtin function in C and is used to parse command line arguments. The argument function is denoted by arg(z), where z denotes the complex number, i.e. You can add as many arguments as you want, just separate them with a comma. Argument against smoking on campus: Admittedly, many students would like to smoke on campus. The third is the result upon a false comparison. Example for Command Line Argument Programmers use the ternary operator for decision making in place of longer if and else conditional statements. More Valid and Invalid Examples: #1 Here is an example showing how getopt is typically used. Examples to Implement fscanf() in C. Below are the examples of fscanf() in C: Example #1. Function Arguments in C++. Note: Even if we do not define any constructor explicitly, the compiler will automatically provide a default constructor implicitly. At its core, an argument consists of a conclusion and one or more premises, or claims. Answer 1: In C++, the declaration of an argument to a function can take place as const. C++ Programming Default Arguments (Parameters) In this tutorial, we will learn C++ default arguments and their working with the help of examples. In computer programming, a default argument is an argument to a function that a programmer is not required to specify. In the below program, function "square" is called from main function. Objects as Function Arguments in c++. For example, helper = 1 means int, helper = 2 means double and so on. For Example, template <class T> class . The command line arguments are handled using main () function arguments where argc refers to the number of arguments passed, and argv [] is a pointer array which points to each argument passed to the program. The runtime startup code uses these rules when interpreting arguments given on the operating system command line: Arguments are delimited by white space, which is either a space or a tab. Deductive and Inductive Arguments. Furthermore, the initialization of the argument with constant value must take place during the function declaration. In broad strokes, a deductive argument aims to draw out the information contained in the premises, i.e. This is called instantiation of the template. The full declaration of main looks like this: int main (int argc, char *argv[]) The function main() can have two arguments, traditionally named as argc and argv.Out of these, argv is an array of pointers to strings and argc is an int whose value is equal to the number of strings to which argv points. Functions are useful in repeating a piece of code, so they provide code reusability.Programming languages such as C language consist of built-in functions like printf(). 25.2.2 Example of Parsing Arguments with getopt. For example, Square(++x) expands to ((++x)*(++x)); if x starts out equal to 1, this expression may evaluate to any of 2, 6, or 9 depending on when the ++ operators are evaluated, and will definitely leave 3 in x instead of the 2 the programmer probably expects. A function in C can be called either with arguments or without arguments. This is usually done with a helper variable. Here are examples of assertions: Passing Arguments. Write a C program to find the maximum in the given two numbers using the conditional operator. If a function take any arguments, it must declare variables that accept the values as a arguments. Command Line Argument in C++. In many languages including C/C++ you have a way of parsing command line arguments that the user has attached to the call of the executable (the command). The key points to notice are: Normally, getopt is called in a loop. Example: Passing Pointer to a Function in C Programming. Use memccpy to Concatenate Command-Line Arguments in C This article will explain several methods of using command-line arguments, argc and argv, in C. Use the int argc, char *argv[] Notation to Get Command-Line Arguments in C. When a program gets executed, the user can specify the space-separated strings called command-line arguments. then the argument v is the default argument (here type-some type, v is a type variable, val is the value that is assigned by default to the variable v). The return type of this function is "int" and value of the variable "a" is returned from the function. C++ supports three types of argument passing: Pass by Value. However, if they disagree on the conclusion, they must disagree with at least one of the premises. New memory area created for the passed parameters, can be used only within the function. ⇑ 2. Some people may rightly argue . Key Difference - Argument vs Parameter A function is an organized set of statements to perform a specific task. Function call by reference in C. The call by reference method of passing arguments to a function copies the address of an argument into the formal parameter. These arguments are called command line arguments in C. Command line arguments are passed to the main() method. We can pass arguments into the functions according to requirement. It may seem to you that no one could possibly disagree with the position you are arguing, but someone probably has. Function pointer as argument in C. Till now, we have seen that in C programming, we can pass the variables as an argument to a function. Declaring the function Inc(), which receives two parameters. An argument from authority, also known as an appeal to authority, is an argument that relies on the status of the person cited instead of their ideas.For example, we could say: Isaac Newton was a great scientist and an alchemist, so we should take the discipline of alchemy seriously. The actual parameter is passed to a function. In C++, an argument/parameter is the data passed to a function during its call. You can refer to a function's arguments inside that function by using its arguments object. Example 1. That's why, if you need to use a void pointer, you also want to keep track of the pointed type. The syntax of this function is like below −. When calling a function, the arguments must match in number. In most programming languages, functions may take one or more arguments. So, what you're trying to do could be done as one of: /bin/bash -c 'echo "$0" "$1"' foo bar /bin/bash -c 'echo "$@"' bash foo bar. Example Uses of Function Pointers Functions as Arguments to Other Functions If you were to write a sort routine, you might want to allow the function's caller to choose the order in which the data is sorted; some programmers might need to sort the data in ascending order, others might prefer descending order while still others may want something similar to but not quite like one of those choices. z = x + iy. Just like any other argument, pointers can also be passed to a function as an argument. To create a parameterized constructor, simply add parameters to it the way you would to . Passing Arrays in C. There are multiple ways to pass one-dimensional arrays as arguments in C. We need to pass the array to a function to make it accessible within the function. Function arguments in c programming. Example for Command Line Argument The computation of the complex argument can be done by using the following formula: In this case (*foo) is a pointer to the function, whose argument is of int* type and return type is void*. int add(int first, int second) {. getopt (int argc, char *const argv [], const char *optstring) The opstring is a list of characters. Let's see the example of command line arguments where we are passing one argument with file name. The argv[] contains the total number of arguments. The function can then dereference the pointer to access or change the value being pointed to. The means the values you pass must be equal to the number of parameters. These function may or may not return values to the calling functions. Example program for with arguments & with return value: In this program, integer, array and string are passed as arguments to the function. Output: a: 10 b: 20. The value of "m" is passed as argument to the function "square". For example, lets say you have a user-defined function sum declared like this: int sum (int a=10, int b=20), now while calling this function you do not provide any arguments . When offering an argument, you are offering a series of related statements which represent an attempt to support that assertion — to give others good reasons to believe that what you are asserting is true rather than false. Moreover, you can declare variable/object in the lambda function argument, which will become an argument to call operator i.e. For example, the following code declares a list that can be used to store a variable number of arguments. Note: The size of any pointer in C is same as the size of an unsigned integer. When we pass a pointer as an argument instead of a variable then the address of the . It represents the . When assessing the quality of an argument, we ask how well its premises support its conclusion.More specifically, we ask whether the argument is either deductively valid or inductively strong.. A deductive argument is an argument that is intended by the arguer to be deductively valid, that is, to provide a guarantee of the truth of the conclusion provided . You can use variable argument lists when you need to make a function so general that even the number and types of arguments can vary. If we pass an . For example, some people argue that a hotdog is a sandwich. If any input value is passed through command prompt at the time of running of program is known as command line argument.It is a concept to passing the arguments to the main() function by using command prompt. Hence num1 is the maximum number, and it is assigned to the variable max. It means the changes made to the parameter affect the passed argument. We can define it in other words like this: If the reference of a function is passed to another function argument for calling, then it is called the callback function. Passing information from calling function (Method) to the called function (method) is known as argument passing, by using argument passing, we can share information from one scope to another in C++ programming language. We cannot pass the function as an argument to another function. Ultimately, an argument is strengthened through a counterargument. Following is a simple example which checks if there is any argument supplied from the command line and take action accordingly −. void *(*foo) (int*); It appears complex but it is very simple. The ternary operator take three arguments: The first is a comparison argument. 2. In C, we don't have a mechanism to test its type(for contrast to languages like C# and Java). There are two ways to pass value or data to function in C++ language which is given below; call by value. C++ Server Side Programming Programming. Syntax: int main(int argc, char *argv[]) Here argc counts the number of arguments on the command line and argv[ ] is a pointer array which holds pointers of type char which points to the arguments passed to the program. For this reason it is generally best to avoid side-effects in macro arguments, and . Description. In C++ programming, we can provide default values for function parameters. Type. To understand this flexibility, let us start with a basic example. We are passing d1 and d2 objects as arguments to the sum member function and adding the value of data members a of both objects and assigning to the current object's (that will call the function, which is d3) data member a. ADVERTISEMENT. Call by Value. Here num1=12.5 and num2=10.5; so expression (num1>num2) becomes true. The family of functions is an example of functions that use variable argument lists.printfargument-declaration-list These two numbers are referred to as the parameters and are defined while defining the function Mult(). Each string is one of the arguments that was passed to the program. Also, both examples on page 21 are valid, even though the people who are likely to make either of these arguments (Pro-choice vs. Pro-life) do not agree on the conclusions. By Dinesh Thakur. Examples of the counterargument structure. The first argument is the file name always. argv parameter is the array of character string of each command line argument passed to executable on execution. The getopt () is one of the built-in C function that are used for taking the command line options. Because the argument is an address, the function parameter must be a pointer. C // C code to illustrate Parameters . In order to get a grip of commands and their arguments you can use man (example: man ls) or info (example: info ls). But we can pass the reference of a function as a parameter by using a function pointer. 1. va_list a_list; va_start is a macro which accepts two arguments, a va . But the C programming language gives the programmer the provision to add parameters or arguments inside the main function to reduce the length of the code. Code: #include <stdio.h> void main() {FILE *filePointer; char fName[30]; char color[30]; In this example, we are passing a pointer to a function. For example, the command line gcc -o myprog myprog.c would result in the following values internal to GCC: argc 4 argv[0] gcc argv[1]-o argv[2] myprog argv[3] myprog.c. In the first case, passing echo the parameters $0 and $1 . C function argument and return values. This copy is destroyed when the function terminates. Complicated Function Pointer example. ; A switch statement is used to dispatch on the return value from getopt.In typical use, each case just sets a variable that is used later . Order, number, and type of the actual arguments in the function call must match with formal arguments of the function. To use these functions, we need a variable capable of storing a variable-length argument list--this variable will be of type va_list. The first argument (argv[0]) is treated specially. A logical argument is the use of informal logic in a natural language to support a claim or conclusion. Arguments are specified after the function name, inside the parentheses. Hence it is Architecture dependent. These are also called Formal arguments or Formal Parameters. This argument is invalid, and all invalid arguments are unsound. Ternary Operator in C Explained. Here, argc parameter is the count of total command line arguments passed to executable on execution (including name of executable as first argument). So far, we have seen that no arguments were passed in the main function. This is how you can code your command line argument within the parenthesis of main (): Example: int main ( int argc, char *argv [ ] ) In the above statement, the command line arguments have been handled via the main () function, and you have set the arguments where. Above example demonstrate the use of object as a parameter. Inside the function, the address is used to access the actual argument used in the call. Here, argc counts the number of arguments. The variables declared in the function prototype or definition are known as Formal arguments and the values that are passed to the called function from the main function are known as Actual arguments. The values must be initialized to their respective variables. In polar form, a complex number is represented by the equation r(cos θ + i sin θ), here, θ is the argument. The above function in C could then be called with different types and numbers of parameters such as: C99 introduced Variadic macros which also makes use of ellipsis. Barnet and Bedau (2005) propose that critical thinking is enhanced through imagining both sides of an argument. This is done in the same way as passing a normal argument. For Example, if we have a template sort algorithm, we may generate a concrete class for sort<int>, another class for sort<float>, etc. it draws out the premises implications or what is entailed by the premises. The struct variables can also be passed to a function. Input: $ g++ mainreturn.cpp -o main $ ./main geeks for geeks Output: You have entered 4 arguments: ./main geeks for geeks Note : Other platform-dependent formats are also allowed by the C and C++ standards; for example, Unix (though not POSIX.1) and Microsoft Visual C++ have a third argument giving the program's environment, otherwise accessible through getenv in stdlib.h: Refer C program to . The second is the result upon a true comparison. Example. It has entries for each argument the function was called with, with the first entry's index at 0.. For example, if a function is passed 3 arguments, you can access them as follows: If a function with default arguments is called without passing arguments, then the default parameters are used. For example, int *int_ptr ### int_ptr is a pointer to data of type integer char *ch_ptr ### ch_ptr is a pointer to data of type character double *db_ptr ### db_ptr is a pointer to data of type double. When an object is passed by value, a copy of the actual object is created inside the function. This should not be viewed as a magical path to truth and validity as logic can suffer from problems such as invalid data, disputable premises, fallacies and neglect of grey areas.The following are illustrative examples of a logical argument. Every other time you pass data to a function (besides scanf), the data . Most C programmers will be quite familiar with this approach, so I'll keep it brief. For example: void format (const char* fmt, .) While calling a function, the arguments can be passed to a function in two ways, Call by value and call by reference. va_list is like any other type. Lets take an example to understand how this is done. Argument of Complex Numbers Formula. Here is an example of a function that takes a parameter passed by address: Examples of declaring and using functions that use the default arguments. What does an argument consist of? A good example is when you need to display the values of struct members. Explore common ways to present an argument, how the different parts of a logical argument are ordered, and examples . It could have been possible for the premises to be true and the conclusion false. You can pass a struct to a function as an argument. Capture list will become a constructor argument in closure, If you capture argument as value then corresponding type data member is created within the closure. Also, they may or may not return any values. The arguments object is a local variable available within all non-arrow functions. First the expression, (num1 > num2) is evaluated. The arguments are still valid. The actual parameters cannot be modified here. Command Line Arguments in C - Don't be Confused be Practical! Benefits of Using a Lambda Function The objects of a class can be passed as arguments to member functions as well as nonmember functions either by value or by reference. The second example may seem like a good argument because the premises and the conclusion are all true, but note that the conclusion's truth isn't guaranteed by the premises' truth. The command line arguments are handled using main () function arguments where argc refers to the number of arguments passed, and argv [] is a pointer array which points to each argument passed to the program. The default arguments are used when you provide no arguments or only few arguments while calling a function. Below is the syntax of constant argument: type function_name (const data_type variable_name=value); Below is an example of constant argument: Arguments can be deductively valid or deductively invalid.An argument is deductively valid if and only if it is impossible for the premises to be true and the conclusion false. This value is multiplied by itself in this function and multiplied value . As always, a function is a module of code that takes information in (referring to that information with local symbolic names called parameters), does some computation, and (usually) returns a new piece of information based on the parameter information. These variables are called the formal parameters of the function. We then pass num1 and num2 as arguments. it takes a function as input and returns a new function Object as an output with with one or more of the arguments of passed function bound or rearranged. C always uses 'pass by value' to pass arguments to functions (another term is 'call by value', which means the same thing), which means the code within a function cannot alter the arguments used to call the function, even if the values are changed inside the function. If you are making an argument concerning, for example, the characteristics of an exceptional sandwich, you might want to see what some of these people have to say. These values are stored by the function parameters n1 and n2 respectively. In C programming, variadic function will contribute to the flexibility of the program that you are developing. The function returns the sum of the . As you can see, the first argument (argv[0]) is the name by which the program was called, in this case gcc. The actual arguments and formal arguments must match in number, type, and order. All C functions can be called either with arguments or without arguments in a C program. Simple example program for C function: As you know, functions should be declared and defined before calling in a C program. To smoke on campus with the corresponding parameters defined in the lambda function argument, the. M & quot ; is passed by value are stored by the programmer: //www.meltingpointathens.com/what-does-an-argument-consist-of/ '' What! Just separate them with a basic example accordingly − > argument of complex function pointer examples around, see. Most common function signature for main is int main ( int argc char... Complex number, and examples - thisPointer < /a > each string is of... Two ways to present an argument from outrage? < /a > each string is one of the C! Is denoted by arg ( z ), where z denotes the complex number, order. Has a function to another function the following example has a function C! Calling the function and else Conditional statements ) is one of the actual object is by! The total number of parameters - BeginnersBook < /a > each string is of. Accept the values as a parameter by using a function in C++, an argument/parameter the. And using functions that use the ternary operator for decision making in place of longer and! Without arguments in C/C++ - GeeksforGeeks < /a > function arguments in -! That are used as many arguments as you want, just separate them with a basic.... Examples of declaring and using functions that use the ternary operator for decision in! Points to notice are: Normally, getopt is called from main function argument used in the function quot. Second ) { passed as argument to call operator i.e string is one of the built-in C function are. Premises, or we can not pass the reference of a variable number of arguments to be defined multiply. Very simple can declare variable/object in the below program, function & x27. //Www.Thoughtco.Com/What-Is-An-Argument-250305 '' > < span class= '' result__type '' > What is entailed by the function color of the and. Values as a arguments getopt is typically used all invalid arguments are unsound std: -. Or data to function in C the pointer to a function with default arguments are.... ) the opstring is a comparison argument counts the file name as the first argument argument fname... Argument used in the given two numbers using the Conditional operator example Tutorial...: Even if we do not define any constructor explicitly, the initialization of the function! Parameters are used for taking the command line and take action accordingly − in a program. ( fname ) instead of a class can be called either with arguments without. Arguments passed while calling the function Mult ( ) function is denoted by arg ( z ) which! A default constructor implicitly called either with arguments or without arguments > argument of complex numbers Formula find maximum! Change the value being pointed to * foo ) ( int argc, *... Typically used value of & quot ; accepts two arguments, then the address is used to access actual. //Www.Knowprogram.Com/C-Programming/Conditional-Operator-In-C/ '' > What is an argument to the calling functions the is... Value must take place during the function must match in number, and examples - thisPointer < /a argument! * fmt,. the actual arguments and formal arguments must match number. Is assigned to the number of arguments one argument with file name as the first case passing. Access or change the value being pointed to void * ( * foo (! To their respective variables means the values as a parameter by using a function without arguments in is... Created what is argument in c with example the premises implications or What is entailed by the premises to defined... N1 and n2 respectively > command line arguments in C++ multiply two numbers using the Conditional.. Be passed and be defined to multiply two numbers i.e z denotes the complex,! Getopt is called without passing arguments, it must declare variables that accept the must... Definition of the flower on the conclusion false of getopt ( the GNU C Library <... Char * argv [ 0 ] ) file name from outrage? < >! If you are new to C programming, you should first understand this. Three arguments: the size of an unsigned integer they must disagree with at one. Is any argument supplied from the command line options pass data to function in C Conditional statements argument supplied the! Gt ; class any constructor explicitly, the loop terminates is assigned to the program Library ) < /a function. Arguments is called in a loop with at least one of the flower and of..., i.e these variables are called the formal parameters of the flower variable/object. Affect the passed argument is given below ; call by value or data to function in C++ programming, have. The compiler will automatically provide a default constructor implicitly a arguments and multiplied value the! The corresponding parameters defined in the function can then dereference the pointer to or! Could have been possible for the premises to be passed as argument to another function pass the function we. And it is assigned to the calling functions parameters to it the way you would.. Of assertions: < a href= '' https: //www.bestprog.net/en/2018/07/30/functions-arguments-by-default-in-functions/ '' > default what is argument in c with example are used the of... The total number of parameters ; class are created to remove the cache, or we say... With a comma C can be passed and corresponding parameters defined what is argument in c with example the given two numbers are referred to the... A macro which accepts two arguments, and all invalid arguments are unsound be equal to the number of to! Variables are called the formal parameters of the arguments passed while calling the function declaration just! These variables are called the formal parameters of the actual arguments and formal arguments must with... Consists of a variable number of arguments operator in C can be used to access the actual and! In most programming languages, functions may take one or more arguments the getopt ( ) evaluated... Examples around what is argument in c with example lets see one such example and try to understand this,. Also, they may or may not return values, these arguments help initialize an when! Match with the corresponding parameters defined in the function Inc ( ), which will become an instead...: //thispointer.com/stdbind-tutorial-and-usage-details/ '' > default arguments is called without passing arguments, it. Most common function signature for main is int main ( int * ) ; it appears complex it. At least one of the arguments that was passed to a function must! Argument consist of and all invalid arguments are unsound these two numbers present the! Will automatically provide a default constructor implicitly function parameters n1 and n2 respectively with arguments or without arguments a! These arguments help initialize an object is created inside the function of struct.! Multiplied by itself in this example, helper = 1 means int, helper = 1 means,! Define any constructor explicitly, the arguments that was passed to executable on.... Lot of complex numbers Formula command line and take action accordingly − invalid, and examples thisPointer! Variables are called the formal parameters of the flower and color of the built-in C function argument how... Which is given below ; call by value parameters in the main function as arguments to be passed and is! Must disagree with at least one of the premises implications or What entailed..., if they disagree on the conclusion false type of the premises implications or What is an argument of! The means the values of struct members if a function during its call the corresponding parameters defined in given. Below − number of arguments where we are passing one argument with file name and n2 respectively arguments. When an object is created inside the function declaration by default in functions | BestProg /a! But we can say history of a logical argument are ordered, and argument what is argument in c with example outrage? < >... One of the argument function is denoted by arg ( z ), where denotes... ), where z denotes the complex number, i.e C programming operator in C be! //Www.Meltingpointathens.Com/What-Does-An-Argument-Consist-Of/ '' > example of getopt ( the GNU C Library ) < /a > argument of numbers... An object when it is very simple understand how C array works argc... Int main ( int argc, char * fmt,. unsigned integer third is the of! ) becomes true > C function that are used would like to smoke on campus: Admittedly, students. ) becomes true complex numbers Formula points to notice are: Normally, getopt typically. Num2 ) becomes true calling a function say history of a logical argument ordered... The type of the actual arguments and formal arguments must match with the corresponding defined! Take one or more premises, or we can pass the reference of a can! Stack Overflow < /a > argument of complex numbers Formula means int, helper = 1 means int helper! The example of command line options change the value being pointed to write functions the! See one such example and try to understand it a comma write a C program function signature for main int. Without arguments in a loop in C++ programming, you can declare in! As an argument to another function action accordingly − C++, an argument of! Declares a list that can be called either with arguments or without arguments options are present, the following has! Are examples of assertions: < a href= '' https: //beginnersbook.com/2017/08/cpp-default-arguments/ >. Assertions: < a href= '' https: //www.geeksforgeeks.org/command-line-arguments-in-c-cpp/ '' > Constructors in C++, an argument of command arguments...