Home > Backend Development > C++ > What are C operators and punctuation?

What are C operators and punctuation?

WBOY
Release: 2023-09-13 23:21:02
forward
1430 people have browsed it

What are C operators and punctuation?

Operators are used to describe operations that apply to one or more objects. It makes sense mainly in expressions, but also in declarations. It is usually a short sequence using non-alphanumeric characters.

A punctuation mark is used to separate or terminate a list of elements.

The operators and punctuation marks of C language are as follows −

...   &&  -=  >=   ~   +   ;  ]

<<=   &=  ->  >>   %   ,   <  ^
>>=   *=  /=  ^=   &   -   =  {

!=    ++  <<  |=   (   .   >  |

%=    +=  <=  ||   )   /   ?  }

##    --  ==  !   *   :   [   #
Copy after login

Please note that some sequences are used as operators and punctuation marks, such as *, =, :, # and ,.

Some punctuation marks must be used in pairs, such as (), [], {}.

When parsing the input text, the compiler tries to build the longest sequence possible as a token, so when parsing a b, the compiler will recognize the following:

a ++ ++ + b which is not a valid construct
Copy after login

The compiler does not The following will be considered −

a ++ + ++ b which may be valid
Copy after login

The above is the detailed content of What are C operators and punctuation?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template