Skip to content

Commit e7146df

Browse files
author
mikeblome
committed
fixed wording
1 parent 047ac1b commit e7146df

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

docs/cpp/main-function-and-command-line-args.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ If no return value is specified, the compiler supplies a return value of zero. A
4040

4141
**END Microsoft Specific**
4242

43-
The types for `argc` and `argv` are defined by the language. The names `argc`, `argv`, and `envp` are traditional, but are not required by the compiler. For more information and an example, see [Argument Definitions](../cpp/argument-definitions.md).
44-
4543
## Command line arguments
4644

4745
The arguments in the prototype
@@ -51,7 +49,7 @@ int main( int argc, char* argv[], char* envp[]);
5149
int wmain( int argc, wchar_t* argv[], wchar_t* envp[]);
5250
```
5351
54-
allow convenient command-line parsing of arguments and, optionally, access to environment variables. The argument definitions are as follows:
52+
allow convenient command-line parsing of arguments and, optionally, access to environment variables. The types for `argc` and `argv` are defined by the language. The names `argc`, `argv`, and `envp` are traditional, but you can name them whatever you like. The argument definitions are as follows:
5553
5654
*argc*<br/>
5755
An integer that contains the count of arguments that follow in *argv*. The *argc* parameter is always greater than or equal to 1.
@@ -62,7 +60,7 @@ An array of null-terminated strings representing command-line arguments entered
6260
The first command-line argument is always `argv[1]` and the last one is `argv[argc - 1]`.
6361
6462
> [!NOTE]
65-
> By convention, `argv[0]` is the command with which the program is invoked. However, it is possible to spawn a process using [CreateProcess](/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew) and if you use both the first and second arguments (*lpApplicationName* and *lpCommandLine*), `argv[0]` may not be the executable name; use [GetModuleFileName](/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew) to retrieve the executable name, and its fully-qualified path.
63+
> By convention, `argv[0]` is the command with which the program is invoked. However, it is possible to spawn a process using [CreateProcess](/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew) and if you use both the first and second arguments (*lpApplicationName* and *lpCommandLine*), `argv[0]` may not be the executable name; use [GetModuleFileName](/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew) to retrieve the executable name, and its fully-qualified path.
6664
6765
**Microsoft Specific**
6866

0 commit comments

Comments
 (0)