General C++ Programming - April 2021 (Page 3)

Is there some standard Threadpool library
 
Is there some standard threadpool (wikipedia.org/wiki/Thread_pool) library As far I can tell STL does not provide one, and boost provides one, but their do...
[1 reply] : Actually boost does provide i handy example here: https://www.boost.or... (by Kallinteris Andreas)
Dynamical programming
 
I have some code but it is for int. How can I do it with the help string?(Dynamical programming) #include <stdio.h> #include <sys/types.h> #include <iostream...
[no replies]
How to fix error and improve the code?
 
I got below compile errors, need some inputs to fix it and improve the code. #include <iostream> using namespace std; class Foo { public: virtual...
[5 replies] Last: It is actually recommended to use a vector over an dynamic array. Wenn... (by coder777)
Let's play dice! The traditional die is a cube
 
Hello, anyone can help with this problem? Let's play dice! The traditional die is a cube. Each of its six faces shows a diffe...
[2 replies] Last: exercise 1 example is weird. *exactly two* means it happened once, as... (by jonnin)
calculating 2^1000 and its sum of the digits
 
Hi, i have an exercise from eulers 9A where I have to compute 2^1000 and find the sum of its integer. How do I do it? My first intake is this: // t...
[4 replies] Last: BOI, i wasn't expected that.... (by zaahm18)
How to send Date and time to Arduino via pyserial
 
Hello I want to send date and time to my Arduino, when I turn on the light i want it to say light is on or off an the date and time the light turned on. This is...
[2 replies] Last: Asked and answered here -> https://stackoverflow.com/questions/6717643... (by salem c)
by eb1993
AVLTree program keeps timing out.
 
Hi, I am trying to balance an AVL tree with 10 nodes. When I run the code in Xcode, it works fine and passes all three tests, but I am getting a timeout error w...
[2 replies] Last: Please edit your post to include code tags. https://www.cplusplus.com/... (by salem c)
by obeeey
Cannot convert argument
 
Hi, I'm fighting with an error in my cpp project (content and some words are in polish, but I think those parts are redundant). This is the main part of th...
[1 reply] : > float countTime(Rownanie& eq, void(Rownanie::* initF)(), double(Rown... (by salem c)
Multiplatform plugin system
 
Hi guys! I am looking for a c ++ library that works as a plugin system as in this article: http://www.cplusplus.com/articles/48TbqMoL/ but in that article the p...
[4 replies] Last: https://bfy.tw/Qlk4 (by George P)
Uncomfortable with my BCD Int class
 
Hello friends, i have written a class that represents a binary coded decimal integer with 64 bit range, but since im relatively new to c++, i dont feel like i h...
[12 replies] Last: I generated the table with a drive by loop, and did not put hex on the... (by jonnin)
Header Definitions. 1980’s style
 
I am studying source code from 1980’s games. I ran into some things I cannot find and explanation for such as... P.S some of the content inappropriate I...
[2 replies] Last: It's apparently https://github.com/historicalsource/leisuresuitlarry ... (by Ganado)
If statement with incorrect output
 
I have an if statement that works only for one case. For example I have a 0 and 1 case and the 1 case does not return any error but doesn't return the correct o...
[4 replies] Last: Ohhhh I SEE!! Yes, you're absolutely right. I have no idea how I could... (by JamieAl)
SEGMENTATION FAULT (1,2)
 
I got segmentation fault with below code. any idea what is wrong here? #include <map> #include <set> #include <list> #include <cmath> #include <ctime> #inclu...
[21 replies] Last: Can you please confirm if there is a way to remove 10? Shortest path:... (by denver2020)
by Sawayn
C++ Program to Find LCM
 
Examples on different ways to calculate the LCM (Lowest Common Multiple) of two integers using loops and decision making statements. To understand this example...
[4 replies] Last: I agree it's a nice exercise for students. Although the O(log n) algor... (by Ganado)
Need urgent help compile issue (1,2)
 
I got below errors while run the code. any ideawhat are these errors? I use c++14. #include <iostream> #include <vector> #include <memory> #include <numeric>...
[24 replies] Last: Thanks a lot seeplus, for your quick suggestions and guidance. (by denver2020)
Infix to Postfix Conversion With Stack
 
My professor gave us pseudocode as a guide but the parenthesis always end up in the postfix. while there are more characters in the input { Read next symb...
[2 replies] Last: Wow, I feel so dumb. Thank you so much @seeplus! (by LunyJake)
given graph written sequence edges associated distance travel time start destination
 
I got a given graph written sequence edges associated distance travel time start destination. I am given a graph written as sequence of edges with associated di...
[1 reply] : Continue on your existing thread, please. http://www.cplusplus.com/for... (by lastchance)
Need help with compile issue c++14
 
I got the below error from below code. any idea what is wrong here? main.cpp: In function ‘std::string i2r(unsigned int)’: main.cpp:37:59: error: could not...
[2 replies] Last: Thanks for your suggestion. I found the mistake was in line 37 (by denver2020)
2 player Minotaur maze game.
 
I'm trying to implement a turn based game for a 2 player Minotaur maze game. I just need help coding the part where the minotaur is included in the maze (starti...
[2 replies] Last: As formatted: #include <iostream> #include <cctype> #include <ctime... (by seeplus)
Assignment 1 Guess A number
 
I'm new to coding and c++ and we were given an assignment to make a program that generates a random number and the user is asked to guess that number, the probl...
[2 replies] Last: Perhaps: #include <iostream> #include <string> #include <cstdlib> #... (by seeplus)
April 2021 Pages: 12345... 8
  Archived months: [mar2021] [may2021]

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