c programming comments

Hey my name is Junaid. Today I will explain about c programming comments. As you know I have started learn programming series for beginners. I have already explained the printf and scanf now you have to know about the c programming comments. If you have seen any open source code you will observed. That there are some quotations are also written in the program. Which are showing the purpose of the code. Like this.

As you have already seen my last post about c programming scanf. I have already used quote like this which is.

There are many programmer used comments in there coding. Basically comments are used to remember the purpose of the code which is going to written.

Basics of C programming Comments

Comments are the type of documentation which is prepared inside the code. For remind the purpose of the code. Like if I have to create thousands of line of code. Then it’s really hard to remind which code of line is doing what. So we put comments on desired places in throughout the coding for our reminder. It also helps the programmer to finalize the documentation at the end of program.

In other words c programming comments are the Meta data. Or data about the data which helps us to make code reusable for other programmers. There are two types of comments. The first is the single line comments which we used to quote the single line only. The other one is multi-line comments. This is used to comment more than one line.

Syntax Of Single Line Comment

Syntax Of Multiline Comment

Benefits of C Programming Comments

The basic benefit is that when programmers face error in the program he will never delete any line of code. They just comment that code. Because every code is useful and every code have its own logic’s. Programmers spend lot of time on the code that’s why they can’t delete the code for just one error. What they do, initially comments the code and then after resolving the error un-comment the code. Commenting the code is professional practice for efficiently coding.

EnglishUrdu

Final words

I have tried to explain c programming comments. Basically comments are most important technique of the programming which is utilized by the professional programmers. There are basic two uses of c programming comments. One use is to quote the phrased which help us to remind the logic of code. The second one is to quote the block of code to enhance the usability of program. If you have any kind of suggestions. Please share with me through the comments and Facebook Group. I will appreciate if you will share this with your friends. If you think there is any ambiguous thing in this post please let me know my mistakes.

LEAVE A REPLY

CommentLuv badge