answersLogoWhite

0

The only way this can be achieved is by storing the command line arguments in global variables. However, this is not recommended. Global variables should only be used to represent truly global concepts, but command line arguments are local to the main function. The main function's primary role is to parse the command line arguments and invoke the appropriate functions, passing any required arguments (by value) to those functions that specifically require them. The main function's secondary role is to handle any exceptions not handled by the functions that it invokes.

User Avatar

Wiki User

9y ago

What else can I help you with?

Continue Learning about Engineering

In dos what is the function of a parameter?

A parameter is a command-line switch or an argument to a function. We use parameters to specify the input variables for the commands or functions we invoke. For instance, when we want to list the contents of a directory or folder, we have to pass the directory or folder path to the appropriate command so that it knows which directory or folder to process.


How do you get the number of argument from command line?

It is very difficult task.but I will manage it by deep thinking on on the issue.


What is a command argument?

Command line arguments are provided at the time of running the program. Example: Suppose that your program needs input name and its value then running it from commandline(DOS prompt) you provide the values after the program name java xyz name JAX(name is name and value is jax)


What does char argv mean?

The full form of this is: char* argv[]; Where argv is a pointer to a null-terminated array of null-terminated strings. We use this type of argument to pass command line switches to the main function: int main (char * argv[], int argc); The names of these arguments, argv and argc, are conventional. The argc argument tells us how many elements are in the argv argument, such that argv[0] is the full-qualified name of the executable and argv[argc] is the null-terminator of the array. Any and all other elements (argv[n], such that 0<n<argc) represent programmer-defined command-line switches.


Please someone explain you command line argument in C?

Command Line Arguments---- I am trying to explain each word one by oneCommand ------perform specific taskex. When CMD is typed in run window and then press ok button then open a black screen that is called command prompt.Command Line ------on command prompt where command is supplied that is called command line.using command prompt dos commands are executed and java program is also executed using command prompt.for executing java program command is supplied with given syntaxjava java_class_name argument1 argument2.........Java--- is a commandjava_class_name ---name of java file which you want to executeargument1 argument2 --- are the values passing to java application from out sidethese argument1 argument2 are stored in string array argument of main method

Related Questions

What is the length command line argument in character?

Use the function strlen(string);


When the function argument box appears in excel?

When you choose the Insert Function command and then pick a function to use, it will appear so that you can type arguments into it.


What reflects an accurate argument in favor of a command economy?

Which statement reflects an accurate argument in favor of a command economy


What is the getopt function in PHP?

It gets options from the command line argument list. It can be used in PHP 4.3 and above, including PHP 5.


Command line argument?

Command line argument is a value that is passed to a program whenever the program is executed. It is used to avoid hard coding.


What argument is most accepted by command economies?

Fair


In dos what is the function of a parameter?

A parameter is a command-line switch or an argument to a function. We use parameters to specify the input variables for the commands or functions we invoke. For instance, when we want to list the contents of a directory or folder, we have to pass the directory or folder path to the appropriate command so that it knows which directory or folder to process.


What command would you issue from a command prompt to see a listing of the computers in your workgroup?

"net view" is the command and argument, with "net" being the command and "view" being the argument to view computers within your network, domain, or workgroup. As always, type it without the quotations.


What is man command?

The man command of the Linux operating system is the system's documentation pager. Each page argument given to man is normally the name of a program, utility or function. For example, to see the reference manual of the grep program: man grep


How do you write a Linux function that will go to any directory then ls and pwd on it?

WHAT I NEED DONE in .bash_profile define a function go_show, that willGo to a specific directoryPrint your current locationPrint the contents of your current directoryThe directory this function takes you to will be specified as an argument to the function on the command line. You will need to use a positional parameter to do this


What to do when you have a bad argument?

I want to answer the question of linux command , what is the meaning of the tip " bad argument "peg" " in linux system ?


Which two functions are provided to users by the context-sensitive help feature of the Cisco IOS CLI?

determining which option, keyword, or argument is available for the entered command, displaying a list of all available commands within the current mode