Skip to content

Repo sync for protected CLA branch #3667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions docs/c-runtime-library/gets-getws.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_getts", "gets", "_getws"]
helpviewer_keywords: ["getws function", "getts function", "_getws function", "lines, getting", "streams, getting lines", "_getts function", "gets function", "standard input, reading from"]
ms.assetid: 1ec2dd4b-f801-48ea-97c2-892590f16024
---
# gets, _getws
# `gets`, `_getws`

Gets a line from the `stdin` stream. More secure versions of these functions are available; see [gets_s, _getws_s](../c-runtime-library/reference/gets-s-getws-s.md).
Gets a line from the `stdin` stream. More secure versions of these functions are available; see [`gets_s`, `_getws_s`](../c-runtime-library/reference/gets-s-getws-s.md).

> [!IMPORTANT]
> These functions are obsolete. Beginning in Visual Studio 2015, they are not available in the CRT. The secure versions of these functions, gets_s and _getws_s, are still available. For information on these alternative functions, see [gets_s, _getws_s](../c-runtime-library/reference/gets-s-getws-s.md).
> These functions are obsolete. Beginning in Visual Studio 2015, they are not available in the CRT. The secure versions of these functions, `gets_s` and `_getws_s`, are still available. For information on these alternative functions, see [`gets_s`, `_getws_s`](../c-runtime-library/reference/gets-s-getws-s.md).

> [!IMPORTANT]
> This API cannot be used in applications that execute in the Windows Runtime. For more information, see [CRT functions not supported in Universal Windows Platform apps](../cppcx/crt-functions-not-supported-in-universal-windows-platform-apps.md).
Expand All @@ -41,19 +40,19 @@ wchar_t *_getws(

#### Parameters

*buffer*<br/>
*`buffer`*\
Storage location for input string.

## Return Value

Returns its argument if successful. A **NULL** pointer indicates an error or end-of-file condition. Use [ferror](../c-runtime-library/reference/ferror.md) or [feof](../c-runtime-library/reference/feof.md) to determine which one has occurred. If `buffer` is **NULL**, these functions invoke an invalid parameter handler, as described in [Parameter Validation](../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions return **NULL** and set errno to `EINVAL`.
Returns its argument if successful. A **`NULL`** pointer indicates an error or end-of-file condition. Use [`ferror`](../c-runtime-library/reference/ferror.md) or [`feof`](../c-runtime-library/reference/feof.md) to determine which one has occurred. If `buffer` is **`NULL`**, these functions invoke an invalid parameter handler, as described in [Parameter Validation](../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions return **`NULL`** and set `errno` to `EINVAL`.

## Remarks

The `gets` function reads a line from the standard input stream `stdin` and stores it in `buffer`. The line consists of all characters up to and including the first newline character ('\n'). `gets` then replaces the newline character with a null character ('\0') before returning the line. In contrast, the `fgets` function retains the newline character. `_getws` is a wide-character version of `gets`; its argument and return value are wide-character strings.

> [!IMPORTANT]
> Because there is no way to limit the number of characters read by gets, untrusted input can easily cause buffer overruns. Use `fgets` instead.
> Because there is no way to limit the number of characters read by `gets`, untrusted input can easily cause buffer overruns. Use `fgets` instead.

In C++, these functions have template overloads that invoke the newer, secure counterparts of these functions. For more information, see [Secure Template Overloads](../c-runtime-library/secure-template-overloads.md).

Expand All @@ -69,8 +68,8 @@ By default, this function's global state is scoped to the application. To change

|Routine|Required header|
|-------------|---------------------|
|`gets`|\<stdio.h>|
|`_getws`|\<stdio.h> or \<wchar.h>|
|`gets`|`<stdio.h>`|
|`_getws`|`<stdio.h>` or `<wchar.h>`|

For additional compatibility information, see [Compatibility](../c-runtime-library/compatibility.md).

Expand Down Expand Up @@ -101,7 +100,7 @@ Hello there!The line entered was: Hello there!

## See also

[Stream I/O](../c-runtime-library/stream-i-o.md)<br/>
[fgets, fgetws](../c-runtime-library/reference/fgets-fgetws.md)<br/>
[fputs, fputws](../c-runtime-library/reference/fputs-fputws.md)<br/>
[puts, _putws](../c-runtime-library/reference/puts-putws.md)
[Stream I/O](../c-runtime-library/stream-i-o.md)\
[`fgets`, `fgetws`](../c-runtime-library/reference/fgets-fgetws.md)\
[`fputs`, `fputws`](../c-runtime-library/reference/fputs-fputws.md)\
[`puts`, `_putws`](../c-runtime-library/reference/puts-putws.md)
7 changes: 3 additions & 4 deletions docs/c-runtime-library/reference/execl.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["execl"]
helpviewer_keywords: ["execl function"]
ms.assetid: 10f24c52-7ff5-4a61-abcb-fce6d9553f23
---
# execl
# `execl`

The Microsoft-implemented POSIX function name `execl` is a deprecated alias for the [_execl](execl-wexecl.md) function. By default, it generates [Compiler warning (level 3) C4996](../../error-messages/compiler-warnings/compiler-warning-level-3-c4996.md). The name is deprecated because it doesn't follow the Standard C rules for implementation-specific names. However, the function is still supported.
The Microsoft-implemented POSIX function name `execl` is a deprecated alias for the [`_execl`](execl-wexecl.md) function. By default, it generates [Compiler warning (level 3) C4996](../../error-messages/compiler-warnings/compiler-warning-level-3-c4996.md). The name is deprecated because it doesn't follow the Standard C rules for implementation-specific names. However, the function is still supported.

We recommend you use [_execl](execl-wexecl.md) instead. Or, you can continue to use this function name, and disable the warning. For more information, see [Turn off the warning](../../error-messages/compiler-warnings/compiler-warning-level-3-c4996.md#turn-off-the-warning) and [POSIX function names](../../error-messages/compiler-warnings/compiler-warning-level-3-c4996.md#posix-function-names).
We recommend you use [`_execl`](execl-wexecl.md) instead. Or, you can continue to use this function name, and disable the warning. For more information, see [Turn off the warning](../../error-messages/compiler-warnings/compiler-warning-level-3-c4996.md#turn-off-the-warning) and [POSIX function names](../../error-messages/compiler-warnings/compiler-warning-level-3-c4996.md#posix-function-names).

> [!IMPORTANT]
> This API cannot be used in applications that execute in the Windows Runtime. For more information, see [CRT functions not supported in Universal Windows Platform apps](../../cppcx/crt-functions-not-supported-in-universal-windows-platform-apps.md).
35 changes: 17 additions & 18 deletions docs/c-runtime-library/reference/sin-sinf-sinl.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_sinl", "sinf", "sinl", "sin"]
helpviewer_keywords: ["_sinl function", "sinl function", "calculating sines", "sin function", "trigonometric functions", "sinf function"]
ms.assetid: 737de73e-3590-45f9-8257-dc1c0c489dfc
---
# sin, sinf, sinl
# `sin`, `sinf`, `sinl`

Calculates the sine of a floating-point value.

Expand All @@ -30,34 +29,34 @@ long double sin(long double x); // C++ only

### Parameters

*x*\
*`x`*\
Angle in radians.

## Return value

The **sin** functions return the sine of *x*. If *x* is greater than or equal to 263, or less than or equal to -263, a loss of significance in the result occurs.
The **`sin`** functions return the sine of *`x`*. If *`x`* is greater than or equal to 263, or less than or equal to -263, a loss of significance in the result occurs.

|Input|SEH Exception|Matherr Exception|
|-----------|-------------------|-----------------------|
|± QNAN,IND|None|_DOMAIN|
|± ∞ (sin, sinf, sinl)|INVALID|_DOMAIN|
`QNAN`,`IND`|None|`_DOMAIN`|
|± ∞ (`sin`, `sinf`, `sinl`)|`INVALID`|`_DOMAIN`|

For more information about return codes, see [errno, _doserrno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
For more information about return codes, see [`errno`, `_doserrno`, `_sys_errlist`, and `_sys_nerr`](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).

## Remarks

Because C++ allows overloading, you can call overloads of **sin** that take and return **`float`** or **`long double`** values. In a C program, unless you're using the \<tgmath.h> macro to call this function, **sin** always takes and returns **`double`**.
Because C++ allows overloading, you can call overloads of **`sin`** that take and return **`float`** or **`long double`** values. In a C program, unless you're using the `<tgmath.h>` macro to call this function, **`sin`** always takes and returns **`double`**.

If you use the \<tgmath.h> `sin()` macro, the type of the argument determines which version of the function is selected. See [Type-generic math](../../c-runtime-library/tgmath.md) for details.
If you use the `<tgmath.h> sin()` macro, the type of the argument determines which version of the function is selected. See [Type-generic math](../../c-runtime-library/tgmath.md) for details.

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

## Requirements

|Routine|Required header (C)|Required header (C++)|
|-|-|-|
|**sin**, **sinf**, **sinl**|\<math.h>|\<cmath> or \<math.h>|
|**sin()** macro | \<tgmath.h> ||
|**`sin`**, **`sinf`**, **`sinl`**|`<math.h>`|`<cmath>` or `<math.h>`|
|**`sin()`** macro | `<tgmath.h>` ||

For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).

Expand Down Expand Up @@ -91,10 +90,10 @@ cos( 1.570796 ) = 0.000000

## See also

[Floating-Point Support](../../c-runtime-library/floating-point-support.md)<br/>
[acos, acosf, acosl](acos-acosf-acosl.md)<br/>
[asin, asinf, asinl](asin-asinf-asinl.md)<br/>
[atan, atanf, atanl, atan2, atan2f, atan2l](atan-atanf-atanl-atan2-atan2f-atan2l.md)<br/>
[cos, cosf, cosl](cos-cosf-cosl.md)<br/>
[tan, tanf, tanl](tan-tanf-tanl.md)<br/>
[_CIsin](../../c-runtime-library/cisin.md)<br/>
[Floating-Point Support](../../c-runtime-library/floating-point-support.md)\
[`acos`, `acosf`, `acosl`](acos-acosf-acosl.md)\
[`asin`, `asinf`, `asinl`](asin-asinf-asinl.md)\
[`atan`, `atanf`, `atanl`, `atan2`, `atan2f`, `atan2l`](atan-atanf-atanl-atan2-atan2f-atan2l.md)\
[`cos`, `cosf`, `cosl`](cos-cosf-cosl.md)\
[`tan`, `tanf`, `tanl`](tan-tanf-tanl.md)\
[`_CIsin`](../../c-runtime-library/cisin.md)\
33 changes: 16 additions & 17 deletions docs/c-runtime-library/reference/sqrt-sqrtf-sqrtl.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["sqrt", "sqrtf", "_sqrtl"]
helpviewer_keywords: ["sqrtf function", "sqrt function", "sqrtl function", "_sqrtl function", "calculating square roots", "square roots, calculating"]
ms.assetid: 2ba9467b-f172-41dc-8f10-b86f68fa813c
---
# sqrt, sqrtf, sqrtl
# `sqrt`, `sqrtf`, `sqrtl`

Calculates the square root.

Expand All @@ -37,33 +36,33 @@ long double sqrtl(

### Parameters

*x*\
*`x`*\
Non-negative floating-point value

## Remarks

Because C++ allows overloading, you can call overloads of **sqrt** that take **`float`** or **`long double`** types. In a C program, unless you're using the \<tgmath.h> macro to call this function, **sqrt** always takes and returns **`double`**.
Because C++ allows overloading, you can call overloads of **`sqrt`** that take **`float`** or **`long double`** types. In a C program, unless you're using the `<tgmath.h>` macro to call this function, **`sqrt`** always takes and returns **`double`**.

If you use the \<tgmath.h> `sqrt()` macro, the type of the argument determines which version of the function is selected. See [Type-generic math](../../c-runtime-library/tgmath.md) for details.
If you use the `<tgmath.h> sqrt()` macro, the type of the argument determines which version of the function is selected. See [Type-generic math](../../c-runtime-library/tgmath.md) for details.

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

## Return Value

The **sqrt** functions return the square-root of *x*. By default, if *x* is negative, **sqrt** returns an indefinite NaN.
The **`sqrt`** functions return the square-root of *`x`*. By default, if *`x`* is negative, **`sqrt`** returns an indefinite `NaN`.

|Input|SEH Exception|**_matherr** Exception|
|Input|SEH Exception|**`_matherr`** Exception|
|-----------|-------------------|--------------------------|
|± QNAN,IND|none|_DOMAIN|
|- ∞|none|_DOMAIN|
|x<0|none|_DOMAIN|
`QNAN`,`IND`|none|`_DOMAIN`|
|- ∞|none|`_DOMAIN`|
|`x<0`|none|`_DOMAIN`|

## Requirements

|Function|C header|C++ header|
|--------------|--------------|------------------|
|**sqrt**, **sqrtf**, **sqrtl**|\<math.h>|\<cmath>|
|**sqrt()** macro | \<tgmath.h> ||
|**`sqrt`**, **`sqrtf`**, **`sqrtl`**|`<math.h>`|`<cmath>`|
|**`sqrt()`** macro | `<tgmath.h>` ||

For compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).

Expand Down Expand Up @@ -94,8 +93,8 @@ The square root of 45.35 is 6.73

## See also

[Floating-Point Support](../../c-runtime-library/floating-point-support.md)<br/>
[exp, expf, expl](exp-expf.md)<br/>
[log, logf, log10, log10f](log-logf-log10-log10f.md)<br/>
[pow, powf, powl](pow-powf-powl.md)<br/>
[_CIsqrt](../../c-runtime-library/cisqrt.md)<br/>
[Floating-Point Support](../../c-runtime-library/floating-point-support.md)\
[`exp`, `expf`, `expl`](exp-expf.md)\
[`log`, `logf`, `log10`, `log10f`](log-logf-log10-log10f.md)\
[`pow`, `powf`, `powl`](pow-powf-powl.md)\
[`_CIsqrt`](../../c-runtime-library/cisqrt.md)\
Loading