Blog

Page 658 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for Read whole ASCII file into C++ std::string
file-iostring

Read whole ASCII file into C++ std::string

Published on September 2, 2023

# Reading a Whole ASCII File into C++ std::string So, you want to read an entire ASCII file into a C++ `std::string`, huh? And you don't want to use any pesky loops? No problemo! πŸš€ First things first, let's understand the context. You have a simple solu

Cover Image for How can I convert a std::string to int?
integerstring

How can I convert a std::string to int?

Published on September 2, 2023

## πŸ“ Converting a std::string to int: Easy Solutions! πŸ’ͺ So, you want to convert a `std::string` to an `int`, but you don't mean ASCII codes. You're not alone! This is a common challenge for many developers. But fear not, because I've got you covered wit

Cover Image for *.h or *.hpp for your class definitions

*.h or *.hpp for your class definitions

Published on September 2, 2023

# **Are you Team *.h or Team *.hpp for class definitions? Let's settle the debate once and for all!** πŸ’₯πŸ“š So, you've been writing C++ code for a while now, and you've always used the traditional "*.h" file extension for your class definitions. But recent

Cover Image for How to determine CPU and memory consumption from inside a process
c#memory

How to determine CPU and memory consumption from inside a process

Published on September 2, 2023

# How to determine CPU and memory consumption from inside a process πŸ–₯οΈπŸ’Ύ Do you ever wonder how to determine your CPU and memory consumption from inside your application? πŸ€” It can be quite a frustrating task, right? You're not alone! Many developers fac

Cover Image for What does the C++ standard state the size of int, long type to be?

What does the C++ standard state the size of int, long type to be?

Published on September 2, 2023

πŸ“πŸ’»πŸŽ‰ **Hey there fellow tech enthusiasts!** πŸŽ‰πŸ’»πŸ“ Have you ever wondered about the size of basic C++ types? πŸ€”πŸ’­ Well, you're not alone! Many developers find themselves in search of detailed information regarding this topic. πŸ“šβœοΈ The answer to this qu

Cover Image for C++ code file extension? What is the difference between .cc and .cpp
filenames

C++ code file extension? What is the difference between .cc and .cpp

Published on September 2, 2023

# C++ Code File Extension: .cc vs .cpp πŸ“πŸ€” So, you're working with C++ code and have come across the file extensions .cc and .cpp πŸ€”. You might be wondering if there's any difference between the two and which one you should use, especially for programs o

Cover Image for Difference of keywords "typename" and "class" in templates?
keyword

Difference of keywords "typename" and "class" in templates?

Published on September 2, 2023

πŸ“ What's the Difference Between 'typename' and 'class' in Templates? πŸ€” Are you confused about the different declarations you've seen for templates, specifically the keywords 'typename' and 'class'? You're not alone! Let's dive into this topic to underst

Cover Image for What is meant with "const" at end of function declaration?

What is meant with "const" at end of function declaration?

Published on September 2, 2023

πŸ“ Hey there, tech enthusiasts! πŸ–₯️ Are you familiar with the mysterious "const" that sometimes appears at the end of function declarations? πŸ€” Fear not! πŸ¦Έβ€β™€οΈ Today, we are going to dive into the world of "const" and shed some light on its purpose and si

Cover Image for How to call a parent class function from derived class function?
inheritanceoop

How to call a parent class function from derived class function?

Published on September 2, 2023

# How to Call a Parent Class Function from Derived Class Function? So you've got a parent class and a derived class, and you want to call a function defined in the parent class from within the derived class. Fear not, because I'm here to guide you throug

Cover Image for Read file line by line using ifstream in C++
file-io

Read file line by line using ifstream in C++

Published on September 2, 2023

πŸ“ **Read file line by line using ifstream in C++** So, you have a file and you want to read its contents line by line using the `ifstream` in C++. Easy peasy lemon squeezy, my friend! Let's dive right into it and solve this problem together! But before