The data or parameters provided while invoking the program are known as command-line parameters or arguments. Command-line arguments can be accessed using the variables declared in the signature of main() function as shown below: int main(int argc, char *argv) In the above syntax, first parameter argc holds the count of command-line arguments and the second parameter, an array of character pointers holds the actual command-line arguments. Note: Remember that the first element in the array, i.e., argv holds the filename. First command-line parameter will be available in argv, second parameter in argv and so on. Following program
The post How to access the command line arguments in C++ appeared first on Coding Security.
How to access the command line arguments in C++
read more
Tidak ada komentar:
Posting Komentar