Skip to content

Commit 7a3ef0c

Browse files
author
mikeblome
committed
another try at redirect and some edits in main file
1 parent fd2494c commit 7a3ef0c

2 files changed

Lines changed: 5 additions & 79 deletions

File tree

.openpublishing.redirection.json

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -730,76 +730,6 @@
730730
"redirect_url": "/cpp/cpp/character-sets",
731731
"redirect_document_id": false
732732
},
733-
{
734-
"source_path": "docs/cpp/using-wmain-instead-of-main.md",
735-
"redirect_url": "/cpp/cpp/main-function-and-command-line-args",
736-
"redirect_document_id": false
737-
},
738-
{
739-
"source_path": "docs/cpp/main-program-startup.md",
740-
"redirect_url": "/cpp/cpp/main-function-and-command-line-args",
741-
"redirect_document_id": false
742-
},
743-
{
744-
"source_path": "docs/cpp/main-function-restrictions.md",
745-
"redirect_url": "/cpp/cpp/main-function-and-command-line-args",
746-
"redirect_document_id": false
747-
},
748-
{
749-
"source_path": "docs/cpp/additional-startup-considerations.md",
750-
"redirect_url": "/cpp/cpp/main-function-and-command-line-args",
751-
"redirect_document_id": false
752-
},
753-
{
754-
"source_path": "docs/cpp/wildcard-expansion.md",
755-
"redirect_url": "/cpp/cpp/main-function-and-command-line-args",
756-
"redirect_document_id": false
757-
},
758-
{
759-
"source_path": "docs/cpp/parsing-cpp-command-line-arguments.md",
760-
"redirect_url": "/cpp/cpp/main-function-and-command-line-args",
761-
"redirect_document_id": false
762-
},
763-
{
764-
"source_path": "docs/cpp/customizing-cpp-command-line-processing.md",
765-
"redirect_url": "/cpp/cpp/main-function-and-command-line-args",
766-
"redirect_document_id": false
767-
},
768-
{
769-
"source_path": "docs/cpp/startup-and-termination-cpp.md",
770-
"redirect_url": "/cpp/cpp/main-function-and-command-line-args",
771-
"redirect_document_id": false
772-
},
773-
{
774-
"source_path": "docs/cpp/argument-definitions.md",
775-
"redirect_url": "/cpp/cpp/main-function-and-command-line-args",
776-
"redirect_document_id": false
777-
},
778-
{
779-
"source_path": "docs/cpp/exit-function.md",
780-
"redirect_url": "/cpp/cpp/program-termination",
781-
"redirect_document_id": false
782-
},
783-
{
784-
"source_path": "docs/cpp/abort-function.md",
785-
"redirect_url": "/cpp/cpp/program-termination",
786-
"redirect_document_id": false
787-
},
788-
{
789-
"source_path": "docs/cpp/return-statement-in-program-termination-cpp.md",
790-
"redirect_url": "/cpp/cpp/program-termination",
791-
"redirect_document_id": false
792-
},
793-
{
794-
"source_path": "docs/cpp/using-exit-or-return.md",
795-
"redirect_url": "/cpp/cpp/program-termination",
796-
"redirect_document_id": false
797-
},
798-
{
799-
"source_path": "docs/cpp/using-atexit.md",
800-
"redirect_url": "/cpp/cpp/program-termination",
801-
"redirect_document_id": false
802-
},
803733
{
804734
"source_path": "docs/cpp/index.md",
805735
"redirect_url": "/cpp/cpp/cpp-language-reference",

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ All C++ programs must have a `main` function. If you try to compile a C++ *.exe*
1414
- Cannot have its address taken.
1515
- Cannot be called.
1616

17-
If your source files use Unicode wide characters, you can use `wmain`, which is the wide-character version of `main`.
18-
19-
The `main` function is not predefined by the compiler. It must be supplied in the program text.
20-
2117
The declaration syntax for `main` is as follows:
2218

2319
```cpp
@@ -27,7 +23,7 @@ int main(int argc, char *argv[], char *envp[]);
2723
2824
**Microsoft Specific**
2925
30-
The declaration syntax for `wmain` is as follows:
26+
If your source files use Unicode wide characters, you can use `wmain`, which is the wide-character version of `main`. The declaration syntax for `wmain` is as follows:
3127
3228
```cpp
3329
int wmain( );
@@ -42,14 +38,14 @@ If no return value is specified, the compiler supplies a return value of zero. A
4238

4339
## Command line arguments
4440

45-
The arguments in the prototype
41+
The arguments for `main` or `wmain` 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.
4642

4743
```cpp
4844
int main( int argc, char* argv[], char* envp[]);
4945
int wmain( int argc, wchar_t* argv[], wchar_t* envp[]);
5046
```
5147
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:
48+
The argument definitions are as follows:
5349
5450
*argc*<br/>
5551
An integer that contains the count of arguments that follow in *argv*. The *argc* parameter is always greater than or equal to 1.
@@ -69,7 +65,7 @@ The *envp* array, which is a common extension in many UNIX systems, is used in M
6965
7066
**END Microsoft Specific**
7167
72-
## Example
68+
### Example
7369
7470
The following example shows how to use the *argc*, *argv*, and *envp* arguments to `main`:
7571
@@ -117,7 +113,7 @@ Microsoft C/C++ startup code uses the following rules when interpreting argument
117113

118114
- If an odd number of backslashes is followed by a double quotation mark, one backslash is placed in the `argv` array for every pair of backslashes, and the double quotation mark is "escaped" by the remaining backslash, causing a literal double quotation mark (") to be placed in `argv`.
119115

120-
## Example
116+
### Example
121117

122118
The following program demonstrates how command-line arguments are passed:
123119

0 commit comments

Comments
 (0)