msdn parse command line

Solutions on MaxInterview for msdn parse command line by the best coders in the world

showing results for - "msdn parse command line"
Edoardo
04 Jan 2020
1// Parsing_C_Commandline_args.c
2// ARGS.C illustrates the following variables used for accessing
3// command-line arguments and environment variables:
4// argc  argv  envp
5//
6
7#include <stdio.h>
8
9int main( int argc, // Number of strings in array argv
10char *argv[],      // Array of command-line argument strings
11char **envp )      // Array of environment variable strings
12{
13    int count;
14
15    // Display each command-line argument.
16    printf_s( "\nCommand-line arguments:\n" );
17    for( count = 0; count < argc; count++ )
18        printf_s( "  argv[%d]   %s\n", count, argv[count] );
19
20    // Display each environment variable.
21    printf_s( "\nEnvironment variables:\n" );
22    while( *envp != NULL )
23        printf_s( "  %s\n", *(envp++) );
24
25    return;
26}
27
similar questions
queries leading to this page
msdn parse command line