Skip to content

Commit 70a668f

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#1887 from MicrosoftDocs/master637160116531947229
Fix git push error for protected CLA branch
2 parents ecb3c85 + 6841815 commit 70a668f

2 files changed

Lines changed: 41 additions & 46 deletions

File tree

docs/c-runtime-library/reference/popen-wpopen.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
---
22
title: "_popen, _wpopen"
3-
ms.date: "11/04/2016"
3+
description: "A reference for the Microsoft C runtime (CRT) library functions _popen and _wpopen."
4+
ms.date: "01/28/2020"
45
api_name: ["_popen", "_wpopen"]
56
api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-stdio-l1-1-0.dll"]
67
api_type: ["DLLExport"]
78
topic_type: ["apiref"]
89
f1_keywords: ["tpopen", "popen", "wpopen", "_popen", "_wpopen", "_tpopen"]
910
helpviewer_keywords: ["tpopen function", "pipes, creating", "_popen function", "_tpopen function", "popen function", "wpopen function", "_wpopen function"]
1011
ms.assetid: eb718ff2-c87d-4bd4-bd2e-ba317c3d6973
12+
no-loc: [_popen, _wpopen, _tpopen, _doserrno, errno, _sys_errlist, _sys_nerr, EINVAL]
1113
---
1214
# _popen, _wpopen
1315

@@ -31,21 +33,21 @@ FILE *_wpopen(
3133

3234
### Parameters
3335

34-
*command*<br/>
36+
*command*\
3537
Command to be executed.
3638

37-
*mode*<br/>
39+
*mode*\
3840
Mode of the returned stream.
3941

40-
## Return Value
42+
## Return value
4143

42-
Returns a stream associated with one end of the created pipe. The other end of the pipe is associated with the spawned command's standard input or standard output. The functions return **NULL** on an error. If the error is an invalid parameter, such as if *command* or *mode* is a null pointer, or *mode* is not a valid mode, **errno** is set to **EINVAL**. See the Remarks section for valid modes.
44+
Returns a stream associated with one end of the created pipe. The other end of the pipe is associated with the spawned command's standard input or standard output. The functions return **NULL** on an error. If the error is caused by an invalid parameter, **errno** is set to **EINVAL**. See the Remarks section for valid modes.
4345

4446
For information about these and other error codes, see [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
4547

4648
## Remarks
4749

48-
The **_popen** function creates a pipe and asynchronously executes a spawned copy of the command processor with the specified string *command*. The character string *mode* specifies the type of access requested, as follows.
50+
The **_popen** function creates a pipe. It then asynchronously executes a spawned copy of the command processor, and uses *command* as the command line. The character string *mode* specifies the type of access requested, as follows.
4951

5052
|Access mode|Description|
5153
|-|-|
@@ -107,7 +109,7 @@ int main( void )
107109

108110
while(fgets(psBuffer, 128, pPipe))
109111
{
110-
printf(psBuffer);
112+
puts(psBuffer);
111113
}
112114

113115
/* Close pipe and print return value of pPipe. */
@@ -122,9 +124,7 @@ int main( void )
122124
}
123125
```
124126
125-
### Sample Output
126-
127-
This output assumes that there is only one file in the current directory with a .c file name extension.
127+
This output assumes there's only one file in the current directory that has a `.c` file name extension.
128128
129129
```Output
130130
Volume in drive C is CDRIVE
@@ -141,6 +141,6 @@ Process returned 0
141141

142142
## See also
143143

144-
[Process and Environment Control](../../c-runtime-library/process-and-environment-control.md)<br/>
145-
[_pclose](pclose.md)<br/>
146-
[_pipe](pipe.md)<br/>
144+
[Process and environment control](../../c-runtime-library/process-and-environment-control.md)\
145+
[_pclose](pclose.md)\
146+
[_pipe](pipe.md)

docs/standard-library/initializer-list-class.md

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
2-
title: "initializer_list Class"
3-
ms.date: "11/04/2016"
2+
title: "initializer_list class"
3+
description: "A reference for the initializer_list class in the C++ Standard library, as implemented by Microsoft in Visual Studio."
4+
ms.date: "01/28/2020"
45
f1_keywords: ["initializer_list/std::initializer_list::initializer_list", "initializer_list/std::initializer_list::begin", "initializer_list/std::initializer_list::end", "initializer_list/std::initializer_list::size"]
56
ms.assetid: 1f2c0ff4-5636-4f79-b008-e75426e3d2ab
67
helpviewer_keywords: ["std::initializer_list::initializer_list", "std::initializer_list::begin", "std::initializer_list::end", "std::initializer_list::size"]
78
---
8-
# initializer_list Class
9+
# initializer_list class
910

1011
Provides access to an array of elements in which each member is of the specified type.
1112

@@ -18,9 +19,8 @@ class initializer_list
1819
1920
### Parameters
2021
21-
|Parameter|Description|
22-
|---------------|-----------------|
23-
|*Type*|The element data type to be stored in the `initializer_list`.|
22+
*Type*\
23+
The element data type to be stored in the `initializer_list`.
2424
2525
## Remarks
2626
@@ -30,24 +30,24 @@ An `initializer_list` can be constructed using a braced initializer list:
3030
initializer_list<int> i1{ 1, 2, 3, 4 };
3131
```
3232

33-
The compiler transforms braced initializer lists with homogeneous elements into an `initializer_list` whenever the function signature requires an `initializer_list`. For more details on using `initializer_list`, see [Uniform Initialization and Delegating Constructors](../cpp/uniform-initialization-and-delegating-constructors.md)
33+
The compiler transforms braced initializer lists with homogeneous elements into an `initializer_list` whenever the function signature requires an `initializer_list`. For more information about using `initializer_list`, see [Uniform initialization and delegating constructors](../cpp/uniform-initialization-and-delegating-constructors.md)
3434

3535
### Constructors
3636

3737
|Constructor|Description|
3838
|-|-|
39-
|[initializer_list](../standard-library/forward-list-class.md#forward_list)|Constructs an object of type `initializer_list`.|
39+
|[initializer_list](#initializer_list)|Constructs an object of type `initializer_list`.|
4040

4141
### Typedefs
4242

4343
|Type name|Description|
4444
|-|-|
45-
|value_type|The type of the elements in the `initializer_list`.|
46-
|reference|A type that provides a reference to an element in the `initializer_list`.|
47-
|const_reference|A type that provides a constant reference to an element in the `initializer_list`.|
48-
|size_type|A type that represents the number of elements in the `initializer_list`.|
49-
|iterator|A type that provides an iterator for the `initializer_list`.|
50-
|const_iterator|A type that provides a constant iterator for the `initializer_list`.|
45+
|`value_type`|The type of the elements in the `initializer_list`.|
46+
|`reference`|A type that provides a reference to an element in the `initializer_list`.|
47+
|`const_reference`|A type that provides a constant reference to an element in the `initializer_list`.|
48+
|`size_type`|A type that represents the number of elements in the `initializer_list`.|
49+
|`iterator`|A type that provides an iterator for the `initializer_list`.|
50+
|`const_iterator`|A type that provides a constant iterator for the `initializer_list`.|
5151

5252
### Member functions
5353

@@ -71,12 +71,10 @@ Returns a pointer to the first element in an `initializer_list`.
7171
constexpr const InputIterator* begin() const noexcept;
7272
```
7373

74-
### Return Value
74+
### Return value
7575

7676
A pointer to the first element of the `initializer_list`. If the list is empty, the pointer is the same for the beginning and end of the list.
7777

78-
### Remarks
79-
8078
## <a name="end"></a> initializer_list::end
8179

8280
Returns a pointer to one past the last element in an `initializer list`.
@@ -85,9 +83,9 @@ Returns a pointer to one past the last element in an `initializer list`.
8583
constexpr const InputIterator* end() const noexcept;
8684
```
8785

88-
### Return Value
86+
### Return value
8987

90-
A pointer to one past the last element in the list. If the list is empty, this is the same as the pointer to the first element in the list.
88+
A pointer to one past the last element in the list. If the list is empty, it's the same as the pointer to the first element in the list.
9189

9290
## <a name="initializer_list"></a> initializer_list::initializer_list
9391

@@ -100,14 +98,15 @@ initializer_list(const InputIterator First, const InputIterator Last);
10098
10199
### Parameters
102100
103-
|Parameter|Description|
104-
|---------------|-----------------|
105-
|*First*|The position of the first element in the range of elements to be copied.|
106-
|*Last*|The position of the first element beyond the range of elements to be copied.|
101+
*First*\
102+
The position of the first element in the range of elements to be copied.
103+
104+
*Last*\
105+
The position of the first element beyond the range of elements to be copied.
107106
108107
### Remarks
109108
110-
An `initializer_list` is based on an array of objects of the specified type. Copying an `initializer_list` creates a second instance of a list pointing to the same objects; the underlying objects are not copied.
109+
An `initializer_list` is based on an array of objects of the specified type. Copying an `initializer_list` creates a second instance of a list pointing to the same objects; the underlying objects aren't copied.
111110
112111
### Example
113112
@@ -156,11 +155,6 @@ int main()
156155
cout << " " << c;
157156
cout << endl;
158157
159-
cout << "c4 =";
160-
for (auto c : c4)
161-
cout << " " << c;
162-
cout << endl;
163-
164158
cout << "c5 =";
165159
for (auto c : c5)
166160
cout << " " << c;
@@ -169,7 +163,10 @@ int main()
169163
```
170164

171165
```Output
172-
c1 = 3c2 = 5 4 3 2 1c3 = 5 4 3 2 1c4 = 5 4c5 = 5 4
166+
c1 = 3
167+
c2 = 5 4 3 2 1
168+
c3 = 5 4 3 2 1
169+
c5 = 5 4
173170
```
174171

175172
## <a name="size"></a> initializer_list::size
@@ -180,12 +177,10 @@ Returns the number of elements in the list.
180177
constexpr size_t size() const noexcept;
181178
```
182179

183-
### Return Value
180+
### Return value
184181

185182
The number of elements in the list.
186183

187-
### Remarks
188-
189184
## See also
190185

191186
[<forward_list>](../standard-library/forward-list.md)

0 commit comments

Comments
 (0)