Source code Analysis $ g++ –version g++ (Ubuntu 13.2.0-4ubuntu3) 13.2.0 $ g++ main.cpp -g $ gdb a.out (gdb) b 6
Continue readingCategory: Programming
Data structures – Time complexity (libstdc++)
Cases B … Best case A … Average case W … Worst case If there is nothing mentioned, it matches
Continue readingLayout of std::unordered_set (libstdc++)
Layout The meta element on the stack consumes 7 words (56 Byte on x64, 28 Byte on x86). Each node
Continue readingLayout of std:deque (libstdc++)
Layout The meta element on the stack consumes 10 words (80 Byte on x64, 40 Byte on x86). Each chunk
Continue readingConceptual distinction – Programming (C++)
lvalue vs. rvalue An lvalue is usually on the left side of an assignment and is addressable in the memory.
Continue readingSingle vs. double quotes (C++ / PS)
C++ char c = ‘a’; // Character char* s = “abc\ndef”; // Null-terminated C-string PS > $a = 42 >
Continue readingDeleter – std::shared_ptr vs. std::unique_ptr
For the std::unique_ptr the deleter is part of the type and the std::shared_ptr keeps it as part of its control
Continue readingTypes of mutexes and locks (C++)
Mutexes (Selection) … synchronizes the access on critical sections std::mutex Provides exclusive access (can only be pulled by one thread
Continue readingNull-terminated strings (C++)
If you are working with strings you have two basic ways to define its length. Either you write a specific
Continue reading