You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
helpviewer_keywords: ["_wcmdln global variable", "wcmdln global variable", "_acmdln global variable", "_tcmdln global variable", "tcmdln global variable", "acmdln global variable"]
11
11
ms.assetid: 4fc0a6a0-3f93-420a-a19f-5276061ba539
12
12
---
@@ -16,7 +16,7 @@ Internal CRT global variable. The command line.
The `__argc` global variable is a count of the number of command-line arguments passed to the program. `__argv` is a pointer to an array of single-byte-character or multi-byte-character strings that contain the program arguments, and `__wargv` is a pointer to an array of wide-character strings that contain the program arguments. These global variables provide the arguments to `main` or `wmain`.
16
+
The **`__argc`** global variable is a count of the number of command-line arguments passed to the program. **`__argv`** is a pointer to an array of single-byte-character or multi-byte-character strings that contain the program arguments, and **`__wargv`** is a pointer to an array of wide-character strings that contain the program arguments. These global variables provide the arguments to `main` or `wmain`.
17
17
18
18
## Syntax
19
19
@@ -25,23 +25,23 @@ extern wchar_t ** __wargv;
25
25
26
26
## Remarks
27
27
28
-
In a program that uses the `main` function, `__argc` and `__argv` are initialized at program startup by using the command line that's used to start the program. The command line is parsed into individual arguments, and wildcards are expanded. The count of arguments is assigned to `__argc` and the argument strings are allocated on the heap, and a pointer to the array of arguments is assigned to `__argv`. In a program compiled to use wide characters and a `wmain` function, the arguments are parsed and wildcards are expanded as wide-character strings, and a pointer to the array of argument strings is assigned to `__wargv`.
28
+
In a program that uses the `main` function, **`__argc`** and **`__argv`** are initialized at program startup by using the command line that's used to start the program. The command line is parsed into individual arguments, and wildcards are expanded. The count of arguments is assigned to **`__argc`** and the argument strings are allocated on the heap, and a pointer to the array of arguments is assigned to **`__argv`**. In a program compiled to use wide characters and a `wmain` function, the arguments are parsed and wildcards are expanded as wide-character strings, and a pointer to the array of argument strings is assigned to **`__wargv`**.
29
29
30
30
For portable code, we recommend you use the arguments passed to `main` to get the command-line arguments in your program.
31
31
32
32
### Generic-text routine mappings
33
33
34
-
|Tchar.h routine|_UNICODE not defined|_UNICODE defined|
Copy file name to clipboardExpand all lines: docs/c-runtime-library/buffer-manipulation.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,16 +11,16 @@ Use these routines to work with areas of memory on a byte-by-byte basis.
11
11
12
12
## Buffer-manipulation routines
13
13
14
-
|Routine|Use|
15
-
|-------------|---------|
16
-
|[`_memccpy`](./reference/memccpy.md)|Copy characters from one buffer to another until given character or given number of characters has been copied|
17
-
|[`memchr`, `wmemchr`](./reference/memchr-wmemchr.md)|Return pointer to first occurrence, within specified number of characters, of given character in buffer|
18
-
|[`memcmp`, `wmemcmp`](./reference/memcmp-wmemcmp.md)|Compare specified number of characters from two buffers|
19
-
|[`memcpy`, `wmemcpy`](./reference/memcpy-wmemcpy.md), [`memcpy_s`, `wmemcpy_s`](./reference/memcpy-s-wmemcpy-s.md)|Copy specified number of characters from one buffer to another|
20
-
|[`_memicmp`, `_memicmp_l`](./reference/memicmp-memicmp-l.md)|Compare specified number of characters from two buffers without regard to case|
21
-
|[`memmove`, `wmemmove`](./reference/memmove-wmemmove.md),[`memmove_s`, `wmemmove_s`](./reference/memmove-s-wmemmove-s.md)|Copy specified number of characters from one buffer to another|
22
-
|[`memset`, `wmemset`](./reference/memset-wmemset.md)|Use given character to initialize specified number of bytes in the buffer|
23
-
|[`_swab`](./reference/swab.md)|Swap bytes of data and store them at specified location|
14
+
|Routine|Use|
15
+
|---|---|
16
+
|[`_memccpy`](./reference/memccpy.md)|Copy characters from one buffer to another until given character or given number of characters has been copied|
17
+
|[`memchr`, `wmemchr`](./reference/memchr-wmemchr.md)|Return pointer to first occurrence, within specified number of characters, of given character in buffer|
18
+
|[`memcmp`, `wmemcmp`](./reference/memcmp-wmemcmp.md)|Compare specified number of characters from two buffers|
19
+
|[`memcpy`, `wmemcpy`](./reference/memcpy-wmemcpy.md), [`memcpy_s`, `wmemcpy_s`](./reference/memcpy-s-wmemcpy-s.md)|Copy specified number of characters from one buffer to another|
20
+
|[`_memicmp`, `_memicmp_l`](./reference/memicmp-memicmp-l.md)|Compare specified number of characters from two buffers without regard to case|
21
+
|[`memmove`, `wmemmove`](./reference/memmove-wmemmove.md),[`memmove_s`, `wmemmove_s`](./reference/memmove-s-wmemmove-s.md)|Copy specified number of characters from one buffer to another|
22
+
|[`memset`, `wmemset`](./reference/memset-wmemset.md)|Use given character to initialize specified number of bytes in the buffer|
23
+
|[`_swab`](./reference/swab.md)|Swap bytes of data and store them at specified location|
24
24
25
25
When the source and target areas overlap, only `memmove` is guaranteed to copy the full source properly.
Copy file name to clipboardExpand all lines: docs/c-runtime-library/cgets-cgetws.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Gets a character string from the console. More secure versions of these function
22
22
23
23
## Syntax
24
24
25
-
```
25
+
```C
26
26
char *_cgets(
27
27
char *buffer
28
28
);
@@ -46,30 +46,30 @@ Storage location for data.
46
46
47
47
## Return value
48
48
49
-
`_cgets` and `_cgetws` return a pointer to the start of the string, at `buffer[2]`. If `buffer` is `NULL`, these functions invoke the invalid parameter handler, as described in [Parameter validation](./parameter-validation.md). If execution is allowed to continue, they return `NULL` and set `errno` to `EINVAL`.
49
+
**`_cgets`** and **`_cgetws`** return a pointer to the start of the string, at `buffer[2]`. If *`buffer`* is `NULL`, these functions invoke the invalid parameter handler, as described in [Parameter validation](./parameter-validation.md). If execution is allowed to continue, they return `NULL` and set `errno` to `EINVAL`.
50
50
51
51
## Remarks
52
52
53
-
These functions read a string of characters from the console and store the string and its length in the location pointed to by `buffer`. The `buffer` parameter must be a pointer to a character array. The first element of the array, `buffer[0]`, must contain the maximum length (in characters) of the string to be read. The array must contain enough elements to hold the string, a terminating null character ('\0'), and 2 extra bytes. The function reads characters until a carriage return-line feed (CR-LF) combination or the specified number of characters is read. The string is stored starting at `buffer[2]`. If the function reads a CR-LF, it stores the null character ('\0'). The function then stores the actual length of the string in the second array element, `buffer[1]`.
53
+
These functions read a string of characters from the console and store the string and its length in the location pointed to by *`buffer`*. The *`buffer`* parameter must be a pointer to a character array. The first element of the array, `buffer[0]`, must contain the maximum length (in characters) of the string to be read. The array must contain enough elements to hold the string, a terminating null character ('\0'), and 2 extra bytes. The function reads characters until a carriage return-line feed (CR-LF) combination or the specified number of characters is read. The string is stored starting at `buffer[2]`. If the function reads a CR-LF, it stores the null character ('\0'). The function then stores the actual length of the string in the second array element, `buffer[1]`.
54
54
55
-
Because all editing keys are active when `_cgets` or `_cgetws` is called while in a console window, pressing the F3 key repeats the last entered entry.
55
+
Because all editing keys are active when **`_cgets`** or **`_cgetws`** is called while in a console window, pressing the F3 key repeats the last entered entry.
56
56
57
57
In C++, these functions have template overloads that invoke the newer, secure counterparts of these functions. For more information, see [Secure template overloads](./secure-template-overloads.md).
58
58
59
59
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](global-state.md).
60
60
61
61
### Generic-text routine mappings
62
62
63
-
|Tchar.h routine|`_UNICODE` and `_MBCS` not defined|`_MBCS` defined|`_UNICODE` defined|
0 commit comments