Home / Smart Electronics

C how to comment out a piece of code

time:2024-09-27 15:02:19 Smart Electronics

How to comment out all the code in C

To comment out all C code, i.e., not to compile and execute the code, you can use comment statements. C provides two annotation methods: single-line annotation and multi-line annotation.

 Single-line comments: Use double slashes (//) to comment on a line of code.

This is an example of a one-line comment int a = 10 ; Here's an example of another line of annotation

Multi-line comments: Use a slash followed by an asterisk (/) to start the comment, and an asterisk followed by a slash (/) to end the comment.

《C how to comment out a piece of code》 This does not represent the views of this website. If there is any infringement, please contact us to delete it.

Recommend

Ranking

Tech Beyond