Home  >  Article  >  Backend Development  >  How to enter braces in C++

How to enter braces in C++

下次还敢
下次还敢Original
2024-05-01 12:51:16635browse

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++

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:

  • Left brace: Alt 123
  • Right brace :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:

  • Left bracket: [Shift] [
  • Right bracket: [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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn