Traditional Culture Encyclopedia - Weather inquiry - What does the comment of C language program start with and end with?

What does the comment of C language program start with and end with?

In C language programs, single-line comments start with//and end at the end of the line; Multi-line comments start with/and end with/.

1. Single-line comment: A single-line comment starts with//and ends at the end of the line. The compiler will ignore any text after//,even if it is an important piece of code. Single-line comments are usually used to provide a short description or explanation about the code. For example://This is a single-line comment with int x = 5; //An integer variable x is declared here, with an assignment of 5.

2. Multi-line comments: Multi-line comments start with/and end with/. The compiler ignores all text between these two symbols. Multi-line comments are usually used to provide more detailed instructions or explanations, as well as sample code. For example: */,# include

The application of c language:

1, system development: C language is widely used in system software development, such as operating system, network system and embedded system. C language has become the core language of system development because of its low-level access ability and high-efficiency performance.

2. Operating system: Linux is written based on C language, and Windows operating system also uses C language extensively. C language can directly operate the hardware, so that the operating system can efficiently manage and schedule system resources.

3. Embedded system: C language also occupies a dominant position in the fields of embedded systems such as intelligent devices, robots and automotive electronics. The simplicity and controllability of C language make it an ideal choice for embedded development.

4. Game development: Many large-scale games use C as the main programming language, such as World of Warcraft and CS: GO. The performance and flexibility of C language make it the first choice for game development.

5. Scientific calculation: The efficient performance and numerical calculation ability of C language make it very suitable for scientific calculation, such as weather forecast, numerical analysis, physical simulation and so on.