Home >Backend Development >C++ >How to enter braces in C++
There are two ways to enter curly brackets in C: 1. Single backslash and question mark: { and }; 2. ASCII code: left bracket (Alt 123), right bracket (Alt 125). For special keyboard layouts, you can use shortcut keys: left bracket (Shift [), right bracket (Shift ]).
How to enter braces in C
Method 1: Use a single backslash and question mark
\{
Enter the opening brace \}
Enter the closing brace
Method 2: Use ASCII code
Left brace ASCII code: 123
Right brace ASCII code: 125
Hold Alt
key, then type the corresponding ASCII code in sequence, and then release the Alt
key to enter the curly brackets.
For example:
Alt
123
Alt
125
Special keyboard layouts
Some keyboard layouts, such as the Dvorak layout, may Put the braces in different positions. In this case, you can use the following shortcut keys:
[Shift]
[
[Shift]
]
The above is the detailed content of How to enter braces in C++. For more information, please follow other related articles on the PHP Chinese website!