STL Containers in C++: How to Choose the Right One
The complexity table says list wins. Measured, vector was 30 times faster with the same search. A selection guide for the C++ container library.
Programming powers modern technology — from desktop software and websites to mobile apps, games and enterprise systems. Strong programming skills remain essential for developers, students and technology professionals building modern digital solutions.
MYCPLUS has been publishing programming tutorials, source code examples and practical development guides since 2004. This programming hub brings together tutorials for C, C++, C#, Java, JavaScript, PHP and Python, along with game development and real-world coding examples designed for hands-on learning.
You will find beginner-friendly programming tutorials, practical source code examples and advanced development guides covering object-oriented programming, debugging, modern programming techniques and professional software development practices. Whether you are learning your first language, improving coding skills or exploring modern development technologies, this section provides structured resources for real-world programming and software engineering.
Why MYCPLUS: One of the web’s longest-running programming resources — trusted since 2004 with hundreds of tutorials, practical coding guides, source code examples and developer learning resources designed for real-world programming skills.
The complexity table says list wins. Measured, vector was 30 times faster with the same search. A selection guide for the C++ container library.
A Breakout-style brick game in C and modern C++ for Windows, Linux and macOS terminals: full source, collisions, paddle aim, redraws and timing.
Constructors and destructors in C++ with tested code: initialization order, explicit, = default and = delete, the rule of zero, and virtual destructors.
Exception handling in C++ with tested code: what unwinding really cleans up, safe catching, RAII, noexcept, and when std::expected is the better tool.
Operator overloading in C++ with compiled examples: canonical signatures, member or non-member, defaulted C++20 comparisons, and when not to overload.
How for, while and do-while loops work in C, when to use each, how to leave nested loops, and the loop bugs compilers do not catch.
Unions in C explained with compiled examples: size and layout, type punning rules, tagged unions, and the C++ std::variant alternative.
The difference between malloc and calloc in C, with measured costs, realloc and free, four heap bugs caught by sanitizers, and C++ new and delete.
Setting up a TCP connection takes six system calls. Using it correctly means handling a byte stream with no message boundaries and partial transfers.
The most copied base64 implementation in C has a heap over-read in its own example. Here is a correct one, checked against the RFC 4648 test vectors.
Before it sends a byte, a ping program has to get past the kernel. Portable C for Linux and macOS, the Winsock differences, and all four permission routes.
Three centuries as the indecipherable cipher, and 1.6 milliseconds to break. Working C++ for both directions, plus the attack that recovers the key.