HOWTO avoid mistakes in conditional instructions

In C or C++ it's easy to made mistake in expression of conditional instruction and use assignment instead of comparison. It's presented in below snippet, where we want to check if x is equal to 6: int main(){ int x; /* first case */ /* OK */ if(x==6){ /* sth */ } /*...

Protecting images against saving

If you share on the Internet your images, then you may want to protect them against saving. There're a lot of ways to do it - watermarks, cutting images into multiple smaller pieces and reassembling them by using CSS, tricks with CSS or JavaScript and others. None of them is accurate against experienced...

Less popular way to copy content of a structure

There is instance (let's call it p0) of structure, we create new instance (p1) of the same structure and want to copy content of fields from p0 to p1. The simplest (IMHO also the best) way is to copy field by field. It's presented in following code (in case of p1 all fields are copied, in case of p2...