Skip to content

Commit 358c9dc

Browse files
Merge pull request #4590 from MicrosoftDocs/main638225336785298503sync_temp
For protected CLA branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 3ff1d35 + e17aa5d commit 358c9dc

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

docs/c-runtime-library/to-functions.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
22
description: "Learn more about: to Functions"
33
title: "to Functions"
4-
ms.date: "11/04/2016"
4+
ms.date: 06/15/2023
55
helpviewer_keywords: ["to functions", "string conversion, to different characters", "string conversion, case", "lowercase, converting strings", "uppercase, converting strings", "case, converting", "characters, converting"]
6-
ms.assetid: f636a4c6-8c9f-4be2-baac-064f9dbae300
76
---
87
# `to` functions
98

@@ -27,28 +26,24 @@ The **`to`** functions and macro conversions are as follows.
2726
| `_toupper` | `_toupper` | Converts `c` to uppercase |
2827
| `towupper` | None | Converts c to corresponding wide-character uppercase letter |
2928

30-
To use the function versions of the **`to`** routines that are also defined as macros, either remove the macro definitions with `#undef` directives or don't include CTYPE.H. If you use the /Za compiler option, the compiler uses the function version of `toupper` or `tolower`. Declarations of the `toupper` and `tolower` functions are in STDLIB.H.
29+
To use the function versions of the **`to`** routines that are also defined as macros, either remove the macro definitions with `#undef` directives or don't include `CTYPE.H`. If you use the /Za compiler option, the compiler uses the function version of `toupper` or `tolower`. Declarations of the `toupper` and `tolower` functions are in `STDLIB.H`.
3130

3231
The `__toascii` routine sets all but the low-order 7 bits of `c` to 0, so that the converted value represents a character in the ASCII character set. If `c` already represents an ASCII character, `c` is unchanged.
3332

3433
The `tolower` and `toupper` routines:
3534

3635
- Are dependent on the `LC_CTYPE` category of the current locale (`tolower` calls `isupper` and `toupper` calls `islower`).
37-
3836
- Convert `c` if `c` represents a convertible letter of the appropriate case in the current locale and the opposite case exists for that locale. Otherwise, `c` is unchanged.
3937

4038
The `_tolower` and `_toupper` routines:
4139

4240
- Are locale-independent, much faster versions of `tolower` and **toupper.**
43-
4441
- Can be used only when **isascii(**`c`**)** and either **isupper(**`c`**)** or **islower(**`c`**)**, respectively, are nonzero.
45-
4642
- Have undefined results if `c` isn't an ASCII letter of the appropriate case for converting.
4743

4844
The `towlower` and `towupper` functions return a converted copy of `c` if and only if both of the following conditions are nonzero. Otherwise, `c` is unchanged.
4945

5046
- `c` is a wide character of the appropriate case (that is, for which `iswupper` or **iswlower,** respectively, is nonzero).
51-
5247
- There's a corresponding wide character of the target case (that is, for which `iswlower` or **iswupper,** respectively, is nonzero).
5348

5449
## Example
@@ -63,6 +58,7 @@ The `towlower` and `towupper` functions return a converted copy of `c` if and on
6358

6459
#include <ctype.h>
6560
#include <string.h>
61+
#include <stdio.h>
6662

6763
char msg[] = "Some of THESE letters are Uppercase.";
6864
char *p;
@@ -92,5 +88,5 @@ sOME OF these LETTERS ARE uPPERCASE.
9288
## See also
9389

9490
[Data conversion](./data-conversion.md)\
95-
[Locale](./locale.md)\
91+
[`Locale`](./locale.md)\
9692
[`is`, `isw` routines](./is-isw-routines.md)

0 commit comments

Comments
 (0)