Blog

Page 661 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for Why should C++ programmers minimize use of "new"?
memory-management

Why should C++ programmers minimize use of "new"?

Published on September 2, 2023

# Why should C++ programmers minimize use of 'new'? šŸ’»šŸ”€šŸ˜± So, you stumbled upon this Stack Overflow question about a memory leak with `std::string` when using `std::list<std::string>`. In the comments, someone mentioned that you should "stop using `new`"

Cover Image for How to convert an instance of std::string to lower case
string

How to convert an instance of std::string to lower case

Published on September 2, 2023

# Converting std::string to Lowercase: A Foolproof Guide āœØšŸ”  Have you ever needed to convert a `std::string` to lowercase but found yourself struggling with the `tolower()` function? 😩 Well, fret no more! In this guide, we will explore a foolproof soluti

Cover Image for How to trim an std::string?
trim

How to trim an std::string?

Published on September 2, 2023

# How to Trim an `std::string`? šŸ’” **Are you tired of dealing with pesky whitespace in your `std::string`?** 😩 Whether you're a seasoned programmer or just starting out, trimming a string can be a common task. In this guide, we'll explore the best practi

Cover Image for What are the new features in C++17?

What are the new features in C++17?

Published on September 2, 2023

šŸŽ‰ Introducing C++17: Unveiling the Coolest Features! šŸš€ Hey there, tech fanatics! Get ready to level up your C++ game because C++17 has some awesome new features in store for you. 🤩 In this blog post, we'll dive into the latest additions to the language

Cover Image for What are the rules about using an underscore in a C++ identifier?
naming-conventions

What are the rules about using an underscore in a C++ identifier?

Published on September 2, 2023

šŸ‘‹ Hey there, fellow tech enthusiasts! šŸ‘©ā€šŸ’»šŸ‘Øā€šŸ’» In today's blog post, we're going to address an interesting and commonly asked question in the C++ programming language: what are the rules about using an underscore in a C++ identifier? šŸ˜ƒšŸ’» šŸ¤” So, let'

Cover Image for What does T&& (double ampersand) mean in C++11?

What does T&& (double ampersand) mean in C++11?

Published on September 2, 2023

# What Does T&& (Double Ampersand) Mean in C++11? šŸ¤”šŸ” So, you're diving into the amazing world of C++11 and stumbled upon something that caught your eye - the double ampersand in variable declarations: `T&& var`. 😮 You might be wondering, what on earth

Cover Image for How to convert a std::string to const char* or char*
charstring

How to convert a std::string to const char* or char*

Published on September 2, 2023

## Converting std::string to const char* or char*: A Beginner's Guide Have you ever come across the need to convert an `std::string` to a `const char*` or `char*`? It's a common problem faced by many developers, regardless of their experience level. Thank

Cover Image for What is std::move(), and when should it be used and does it actually move anything?

What is std::move(), and when should it be used and does it actually move anything?

Published on September 2, 2023

# Understanding std::move() and Its Impact on Objects šŸ‘‰šŸšš <p>Have you ever heard of the `std::move()` function and wondered what it does and when to use it? Don't worry, you're not alone! In this blog post, we'll explore the concept of `std::move()` and

Cover Image for Undefined behavior and sequence points

Undefined behavior and sequence points

Published on September 2, 2023

# 🧐 Understanding Undefined Behavior and Sequence Points Are you puzzled by the terms "undefined behavior" and "sequence points" in the context of programming? šŸ¤” Don't worry, you're not alone! Many developers find these concepts confusing, leading to co

Cover Image for Do the parentheses after the type name make a difference with new?
constructorinitialization

Do the parentheses after the type name make a difference with new?

Published on September 2, 2023

# Do the parentheses after the type name make a difference with `new`? šŸ˜•šŸ¤” If you've ever written or read code in a C++-like language, chances are you've come across the `new` keyword. It's commonly used to dynamically allocate memory for objects on the