How do I setup a class that represents an interface? Is this just an abstract base class? 17 s 17 To expand on ...
-
April 19, 2022
- 0 Comments
In many C/C++ macros I’m seeing the code of the macro wrapped in what seems like a meaningless do while loop. Here are ...
-
April 19, 2022
- 0 Comments
What is it? What does it do? When should it be used? Good links are appreciated. 8 s 8
I wrote these two solutions for Project Euler Q14, in assembly and in C++. They implement identical brute force approach for testing the ...
-
April 18, 2022
- 0 Comments
When asking about common undefined behavior in C, people sometimes refer to the strict aliasing rule. What are they talking about? 1Best Answer ...
-
April 18, 2022
- 0 Comments
I want to convert a std::string to lowercase. I am aware of the function tolower(). However, in the past I have had issues ...
-
April 18, 2022
- 0 Comments
In C++, is there any difference between: struct Foo { ... }; and: typedef struct { ... } Foo; 8 s 8 In ...
-
April 18, 2022
- 0 Comments
I’m currently using the following code to right-trim all the std::strings in my programs: std::string s; s.erase(s.find_last_not_of(" \n\r\t")+1); It works fine, but I ...
-
April 17, 2022
- 0 Comments
I stumbled upon Stack Overflow question Memory leak with std::string when using std::list<std::string>, and one of the comments says this: Stop using new ...
-
April 16, 2022
- 0 Comments