Skip to content

Commit 0b14342

Browse files
authored
Merge pull request #3425 from MicrosoftDocs/master
3/4/2021 AM Publish
2 parents 5efc34c + 50e2cdf commit 0b14342

14 files changed

+376
-345
lines changed

docs/build/clang-support-msbuild.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ Clang support for both CMake and MSBuild projects is available in Visual Studio
1515

1616
::: moniker range="msvc-160"
1717

18-
You can use Visual Studio 2019 version 16.2 with Clang to edit, build, and debug C++ Visual Studio projects (MSBuild) that target Windows or Linux.
18+
You can use Visual Studio 2019 version 16.2 and later with Clang to edit, build, and debug C++ Visual Studio projects (MSBuild) that target Windows or Linux.
1919

2020
## Install
2121

2222
For best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have the tools, you can install them by opening the Visual Studio Installer and choosing **C++ Clang tools for Windows** under **Desktop development with C++** optional components. You may prefer to use an existing Clang installation on your machine; if so, choose the **C++ Clang-cl for v142 build tools.** optional component.
2323

24-
The Microsoft C++ Standard Library currently requires at least Clang 8.0.0. The bundled version of Clang gets updated automatically to stay current with updates in the Microsoft implementation of the Standard Library.
24+
The Microsoft C++ Standard Library requires at least Clang 8.0.0.
2525

2626
![Screenshot of the Visual Studio installer with the Individual components tab selected and the C plus plus Clang components visible.](media/clang-install-vs2019.png)
2727

28+
Later versions of Visual Studio provide newer versions of the Clang toolset. The bundled version of Clang gets updated automatically to stay current with updates in the Microsoft implementation of the Standard Library. For example, Visual Studio 2019 version 16.9 includes Clang v11.
29+
2830
## Configure a Windows project to use Clang tools
2931

3032
To configure a Visual Studio project to use Clang, right-click on the project node in **Solution Explorer** and choose **Properties**. Typically, you should first choose **All configurations** at the top of the dialog. Then, under **General** > **Platform Toolset**, choose **LLVM (clang-cl)** and then **OK**.

docs/c-runtime-library/reference/fopen-s-wfopen-s.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
22
title: "fopen_s, _wfopen_s"
33
description: "Describes the API for `fopen_s` and `_wfopen_s`"
4-
ms.date: "11/20/2020"
4+
ms.date: "2/24/2021"
55
api_name: ["_wfopen_s", "fopen_s", "_o__wfopen_s", "_o_fopen_s"]
66
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", "api-ms-win-crt-private-l1-1-0.dll"]
77
api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["fopen_s", "_tfopen_s", "_wfopen_s"]
1010
helpviewer_keywords: ["_wfopen_s function", "opening files, for file I/O", "_tfopen_s function", "tfopen_s function", "wfopen_s function", "fopen_s function", "Unicode [C++], creating files", "Unicode [C++], writing files", "files [C++], opening", "Unicode [C++], files"]
11-
ms.assetid: c534857e-39ee-4a3f-bd26-dfe551ac96c3
1211
---
1312
# `fopen_s`, `_wfopen_s`
1413

@@ -116,6 +115,8 @@ The **`"a"`** mode doesn't remove the EOF marker before appending to the file. A
116115

117116
When the **`"r+"`**, **`"w+"`**, or **`"a+"`** access type is specified, both reading and writing are allowed. (The file is said to be open for "update".) However, when you switch from reading to writing, the input operation must come across an EOF marker. If there's no EOF marker, you must use an intervening call to a file-positioning function. The file-positioning functions are **`fsetpos`**, [`fseek`](fseek-fseeki64.md), and [`rewind`](rewind.md). When you switch from writing to reading, you must use an intervening call to either **`fflush`** or to a file-positioning function.
118117

118+
Starting in C11, you can append **`"x"`** to **`"w"`** or **`"w+"`** to cause the function fail if the file exists, instead of overwriting it.
119+
119120
In addition to the values above, the following characters can be included in *`mode`* to specify the translation mode for newline characters:
120121

121122
|*`mode`* modifier|Translation mode|
@@ -140,7 +141,7 @@ For more information about using text and binary modes in Unicode and multibyte
140141
| **`R`** | Specifies that caching is optimized for, but not restricted to, random access from disk. |
141142
| **`t`** | Specifies a file as temporary. If possible, it isn't flushed to disk. |
142143
| **`D`** | Specifies a file as temporary. It's deleted when the last file pointer is closed. |
143-
| **`ccs=**`_encoding_ | Specifies the encoded character set to use (one of **`UTF-8`**, **`UTF-16LE`**, or **`UNICODE`**) for this file. Leave unspecified if you want ANSI encoding. |
144+
| **`ccs=`**_encoding_ | Specifies the encoded character set to use (one of **`UTF-8`**, **`UTF-16LE`**, or **`UNICODE`**) for this file. Leave unspecified if you want ANSI encoding. |
144145

145146
Valid characters for the *`mode`* string used in **`fopen_s`** and [`_fdopen`](fdopen-wfdopen.md) correspond to *`oflag`* arguments used in [`_open`](open-wopen.md) and [`_sopen`](sopen-wsopen.md), as follows.
146147

@@ -164,7 +165,7 @@ Valid characters for the *`mode`* string used in **`fopen_s`** and [`_fdopen`](f
164165
|**`ccs=UTF-8`**|**`_O_UTF8`**|
165166
|**`ccs=UTF-16LE`**|**`_O_UTF16`**|
166167

167-
If you are using **`rb`** mode, memory mapped Win32 files might also be an option if you don't need to port your code, you expect to read much of the file, or you don't care about network performance.
168+
If you're using **`rb`** mode, memory mapped Win32 files might also be an option if you don't need to port your code, you expect to read much of the file, or you don't care about network performance.
168169

169170
## Requirements
170171

@@ -173,13 +174,13 @@ If you are using **`rb`** mode, memory mapped Win32 files might also be an optio
173174
|**`fopen_s`**|`<stdio.h>`|
174175
|**`_wfopen_s`**|`<stdio.h>` or `<wchar.h>`|
175176

176-
For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
177+
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
177178

178179
## Libraries
179180

180181
All versions of the [C run-time libraries](../../c-runtime-library/crt-library-features.md).
181182

182-
The **`c`**, **`n`**, and **`t`** *`mode`* options are Microsoft extensions for **`fopen_s`** and [`_fdopen`](fdopen-wfdopen.md) and shouldn't be used where ANSI portability is desired.
183+
The **`c`**, **`n`**, and **`t`** *`mode`* options are Microsoft extensions for **`fopen_s`** and [`_fdopen`](fdopen-wfdopen.md) and shouldn't be used where you want ANSI portability.
183184

184185
## Example
185186

docs/c-runtime-library/reference/fputs-fputws.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
---
22
description: "Learn more about: fputs, fputws"
33
title: "fputs, fputws"
4-
ms.date: "4/2/2020"
4+
ms.date: 03/02/2021
55
api_name: ["fputs", "fputws", "_o_fputs", "_o_fputws"]
66
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", "api-ms-win-crt-private-l1-1-0.dll"]
77
api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["fputs", "fputws", "_fputts"]
1010
helpviewer_keywords: ["streams, writing strings to", "fputws function", "_fputts function", "fputs function", "fputts function"]
11-
ms.assetid: d48c82b8-aa17-4830-8c7d-30442ddbb326
1211
---
13-
# fputs, fputws
12+
# `fputs`, `fputws`
1413

1514
Writes a string to a stream.
1615

@@ -29,40 +28,40 @@ int fputws(
2928

3029
### Parameters
3130

32-
*str*<br/>
31+
*`str`*\
3332
Output string.
3433

35-
*stream*<br/>
36-
Pointer to **FILE** structure.
34+
*`stream`*\
35+
Pointer to **`FILE`** structure.
3736

38-
## Return Value
37+
## Return value
3938

40-
Each of these functions returns a nonnegative value if it is successful. On an error, **fputs** and **fputws** return **EOF**. If *str* or *stream* is a null pointer, these functions invoke the invalid parameter handler, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions set **errno** to **EINVAL** and then **fputs** returns **EOF**, and **fputws** returns **WEOF**.
39+
Each of these functions returns a nonnegative value if it is successful. On an error, **`fputs`** and **`fputws`** return **`EOF`**. If *`str`* or *`stream`* is a null pointer, these functions invoke the invalid parameter handler, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions set **`errno`** to **`EINVAL`** and then return **`EOF`**.
4140

42-
See [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md) for more information on these, and other, error codes.
41+
For more information on error codes, see [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
4342

4443
## Remarks
4544

46-
Each of these functions copies *str* to the output *stream* at the current position. **fputws** copies the wide-character argument *str* to *stream* as a multibyte-character string or a wide-character string according to whether *stream* is opened in text mode or binary mode, respectively. Neither function copies the terminating null character.
45+
Each of these functions copies *`str`* to the output *`stream`* at the current position. **`fputws`** copies the wide-character argument *`str`* to *`stream`* as a multibyte-character string or a wide-character string according to whether *`stream`* is opened in text mode or binary mode, respectively. Neither function copies the terminating null character.
4746

48-
The two functions behave identically if the stream is opened in ANSI mode. **fputs** does not currently support output into a UNICODE stream.
47+
The two functions behave identically if the stream is opened in ANSI mode. **`fputs`** doesn't currently support output into a UNICODE stream.
4948

50-
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
49+
By default, this function's global state is scoped to the application. To change it, see [Global state in the CRT](../global-state.md).
5150

52-
### Generic-Text Routine Mappings
51+
### Generic-text routine mappings
5352

5453
|TCHAR.H routine|_UNICODE & _MBCS not defined|_MBCS defined|_UNICODE defined|
5554
|---------------------|------------------------------------|--------------------|-----------------------|
56-
|**_fputts**|**fputs**|**fputs**|**fputws**|
55+
|**`_fputts`**|**`fputs`**|**`fputs`**|**`fputws`**|
5756

5857
## Requirements
5958

6059
|Function|Required header|
6160
|--------------|---------------------|
62-
|**fputs**|\<stdio.h>|
63-
|**fputws**|\<stdio.h> or \<wchar.h>|
61+
|**`fputs`**|\<stdio.h>|
62+
|**`fputws`**|\<stdio.h> or \<wchar.h>|
6463

65-
The console is not supported in Universal Windows Platform (UWP) apps. The standard stream handles that are associated with the console—**stdin**, **stdout**, and **stderr**—must be redirected before C run-time functions can use them in UWP apps. For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
64+
The console isn't supported in Universal Windows Platform (UWP) apps. The standard stream handles that are associated with the console—**`stdin`**, **`stdout`**, and **`stderr`**—must be redirected before C runtime functions can use them in UWP apps. For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
6665

6766
## Example
6867

@@ -85,7 +84,7 @@ Hello world from fputs.
8584

8685
## See also
8786

88-
[Stream I/O](../../c-runtime-library/stream-i-o.md)<br/>
89-
[fgets, fgetws](fgets-fgetws.md)<br/>
90-
[gets, _getws](../../c-runtime-library/gets-getws.md)<br/>
91-
[puts, _putws](puts-putws.md)<br/>
87+
[Stream I/O](../../c-runtime-library/stream-i-o.md)\
88+
[`fgets`, `fgetws`](fgets-fgetws.md)\
89+
[`gets`, `_getws`](../../c-runtime-library/gets-getws.md)\
90+
[`puts`, `_putws`](puts-putws.md)

0 commit comments

Comments
 (0)