General C++ Programming - May 2020 (Page 2)

TicTacToe and Magic Squares
 
Here's cool trick for determining a winner in tic-tac-toe with just 5 lines of code. It's from a 197...
[4 replies] Last: Lastchance and Dutch, those are nice solutions. Thanks. The magic squ... (by dhayden)
Help with hexadecimal math (1,2)
 
I'm working on a personal project where I have 2 bytes in hexadecimal code (25B0) representing anima...
[21 replies] Last: << and >> is the same as multiply/divide by 2? yes. lets take a... (by jonnin)
Cross-platform CMAKE project for old VESA/SVGA DOS Graphics
 
Hello everyone, I've a lot of old code that I used to do in my school days. Those code maily used T...
[2 replies] Last: I want to port them to modern OS Very good learning experience, porti... (by deleted account xyzzy)
Confused on Lock-Free Stack (Linked List) implementation
 
In C++ Concurrency in Action, 2e, The author describes a lock-free thread safe linked list implement...
[15 replies] Last: In order for a use-after free No, it doesnt have to be used within t... (by TheToaster)
Migrate C ++ application from jsoncpp to rapidjson.
 
I have to modify a linux C ++ application developed some time ago, which use the jsoncpp library so...
[2 replies] Last: Thanks. I have to study the operation of jsoncpp and rapidjson in two... (by jstechg)
List
 
#include <iostream> #include <list> using namespace std; template <typename T> class Set { private:...
[3 replies] Last: If you need fast random-access you could use std::vector instead of st... (by Peter87)
by F8Code
Cout's don't appear after adding a loop
 
Hello, this is my first post on cplusplus.com I'm making my first ever game, and I have a problem wi...
[3 replies] Last: Your score decoration loops are messy one-liners, hiding a bug. #inc... (by salem c)
Purge and preset over again a static variable
 
How to purge and preset again a static local variable in function from an initiative outside of it?
[1 reply] : I don't know what you think "purging" a variable is, but maybe this: ... (by dutch)
intersection of two circular lists
 
Hello everyone! Please help with writing a program. It's Very necessary. Write a program Intersectio...
[4 replies] Last: if the lists are massive, you need to make one of them easy to search ... (by jonnin)
by Argi
Instantiating derived class causes crash?
 
Hello, I'm facing a rather strange problem that I need help on solving... So when I instantiate a de...
[5 replies] Last: Yep, I get it now guys. Honestly I never would have noticed that on my... (by Argi)
by frek
My vector "myVec"
 
Would you, please, review my class myVec (to its point here), and tell my why I get the error:" ty...
[4 replies] Last: [quote=TheToaster]1.) Yes. Assuming of course that the class is defaul... (by MikeyBoy)
How to do it?
 
The function reads text from words from a file and returns a two-level dynamic array of pointers to ...
[1 reply] : Break it down into tasks: 1) Create a "two-level dynamic array" of p... (by MikeyBoy)
Constructor Destructor
 
My code is: #include <iostream> #include <random> #include <functional> template <typename Key> st...
[8 replies] Last: [code firstline=23] treap() { treap<int> my_tree = {1,2,3,4... (by MikeyBoy)
C++20: The Unspoken Features
 
The article on C++20 features that you probably haven't heard of. Highly recommended!:) https://...
[1 reply] : I had heard about most of them but interesting features nevertheless. ... (by Peter87)
Track memory on heap (Garbage Collection)
 
how to trace memory leak in c++? Suggest some method to individually trace memory taken by objects i...
[5 replies] Last: I personally think implementing garbage collection in C++ in counter p... (by malibor)
by frek
Copy assignment definition (1,2,3)
 
Hello all, Please take a look at this class, Vector: class Vector { private: double* elem; // elem...
[50 replies] Last: Thanks to all so much. :) (by frek)
QuickJS
 
Hello! I am trying to embed QuickJS into my Visual Studio 2019 project. It works fine except it cann...
[4 replies] Last: Right, I will check it out. Appreciate the help :) (by hassanAman)
sorting with pair
 
H I am trying to sort a text file either based on the first or second. So I would ask the user wheth...
[9 replies] Last: You can indeed sort descending by switching < to >. @andywestken is r... (by lastchance)
How do we have extern for a member of enum
 
how to have extern for a member of enum tried int type of it failed as it's used in a cpp including...
[4 replies] Last: Any enum can be forward-declared when its underlying type is specifi... (by mbozzi)
Size of Array of Vectors in for loop
 
This is a portion of my code: [code firstline=10] int charIs(char input) { vector <char> list = ...
[4 replies] Last: This should work: int charIs(char input) { std::vector<std::arra... (by malibor)
May 2020 Pages: 1234... 9
  Archived months: [apr2020] [jun2020]

This is an archived page. To post a new message, go to the current page.