General C++ Programming - August 2020 (Page 3)

C++ Templated struct definition
 
I have been researching the details of the following struct definition and I have some questions tha...
[4 replies] Last: where I assumed the 'C' in '<C>' was a placeholder.... I'm not sure ... (by MikeyBoy)
by bibo
Regex error: Parenthesis is not closed.
 
int main() { string integer = "(\+|-|\0)[0-9]([0-9]{*})"; //string d1 = "("+integer+"...
[5 replies] Last: #include <string> #include <iostream> #include <regex> #include <algo... (by dhayden)
cant get it to read the text files and display the txt help
 
#include <string> #include <iostream> #include <vector> #include <fstream> using names...
[2 replies] Last: cant get it to read the text files and display the txt help Without... (by dhayden)
race condition
 
Hi! how do I make the following program print numbers in the correct order like this: 0 1 2 ... 100 ...
[6 replies] Last: #include <iostream> #include <thread> #include <mutex> int x = 0; st... (by dhayden)
by Ganado
Struct pointer conversion, possible undefined behavior?
 
I found a place where some weird casting was happening, and I wanted to confirm if someone knew it w...
[9 replies] Last: Cubbi: Okay, that's starting to make more sense. I didn't realize the ... (by Ganado)
by plexus
Weighted random distribution
 
Hi all, I'm trying to generate the numbers 0 .. 9 in a random fashion but with different probabil...
[16 replies] Last: A class based approach to encapsulating <random>/<chrono> is a valid... (by deleted account xyzzy)
Debug C main program
 
I need assistance in debugging a not-very-large C main program. Reason(s) for the crash are not evid...
[2 replies] Last: if its small, you can get solid free help here. Can't hurt to throw ... (by jonnin)
by stav
vector of incomplete type UB still?
 
Hi, i read this article https://www.drdobbs.com/the-standard-librarian-containers-of-inc/184403814 t...
[1 reply] : So i think i've found the answer here https://en.cppreference.com/w/cp... (by stav)
by AJS248
Need some help with int/ double input error checkings
 
I'd like to put a condition for a 'double variable.' For example: cin1: double var1; cin >> va...
[5 replies] Last: #include <iostream> #include <sstream> #include <string> using namesp... (by lastchance)
openssl base64 decode function is not working for specfic string
 
I have the below openssl code to decode json content, it works fine if the encoded data is "eyJ0ZXN0...
[6 replies] Last: yes i will pad it with "=" before decoding, Thanks a lot for clarifyin... (by Scarletpimp)
i need some help
 
During this period of lockdown, many people started to play different games at their homes since th...
[15 replies] Last: Not possible, but you can put the screenshot up on Pinterest or some o... (by againtry)
by Puyol
Black and white kings on the chessboard
 
Inputting the numbers of the white and black king cells on the chessboard in turn, followed by the n...
[2 replies] Last: It’s a trick question because the rules of chess are such that the k... (by againtry)
August 2020 Pages: 123
  Archived months: [jul2020] [sep2020]

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