Category Archives: C++

PostScript – a quick way to visualize algorithms

Sometimes (for example during a programming contest) there is a need of a quick tool for visualizing outcome of an algorithm. PostScript might be a very useful tool then.

Posted in Algorithms, C++ | Tagged , , | Leave a comment

[C++] Interesting example of C++ code obfuscation

Recently a friend of mine has given me a piece of code in C++: puts(&3["abcdef"]);puts(&3["abcdef"]); At first glance it seems to not compile at all. But not only it compiles, but also prints “def”.

Posted in C++ | Tagged , , | Leave a comment

[C++] Measuring entropy of file / partition

You can get further information about entropy here. Here is code of my program entropy.cpp:

Posted in C++ | Tagged , | Leave a comment

[Linux] How to check if program has memory leaks

You can check your program using command: valgrind your_programvalgrind your_program Example of usage: We have following C++ program (tst.cpp): int main() { int * tab = new int[1000000]; return 0; }int main() { int * tab = new int[1000000]; return … Continue reading

Posted in C++, Linux | Tagged , | 1 Comment