Many programmers make mistakes at times by writing “=” instead of “==” in equality test. A good habit of programming is to write the constant first. For example, if we want to test if the length of a string is equal to 0. Instead of writing

strlen(x) == 0

We can

write 0 == strlen(x)

In case we write “=” by mistake,

0 = strlen(x)

The compiler will complain about it.

In this way, we will easily find the bug at the compilation instead of squeezing head.

 

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Set your Twitter account name in your settings to use the TwitterBar Section.