General C++ Programming - April 2021

by lynn22
How do i write the code for balanced array...URGENT please
 
An array with an odd number of elements is said to be balanced if all elements (except the middle on...
[13 replies] Last: To be honest, I have no idea. He says it works, though. I have sugge... (by agent max)
Using CImg to creat 3D object and export to .stl file
 
I have a 15 year old boy that got a job last summer so that he could buy himself a 3d-printer. He ...
[1 reply] : Funny, there was just another thread talking about stl files as well. ... (by Ganado)
having trouble with my hw for stl file
 
* separate compilation Cube.hh Cube.cc Cylinder.hh Cylinder.cc optional: Sphere.hh Sphere.c...
[6 replies] Last: Forgot to give a reply earlier. I'm kind of just winging this, but you... (by Ganado)
Including/using <regex> will not run on some machines?
 
I am creating a dll which gets loaded by a game engine. It runs fine on my dev machine, however doe...
[2 replies] Last: Unfortunately I don't get to see any error message, as I only have the... (by coldscooter)
thread_local std::vector error
 
C++ Builder XE4 this code give the error E2461 'TempOptions' requires run-time initialization/final...
[3 replies] Last: C++ Builder even if it is the latest version (XE4 is from 2013) isn't ... (by Furry Guy)
Greedy algorithm to fill 2d array
 
Hello, can someone help me with the following problem: Is there a way to write a greedy algorithm t...
[10 replies] Last: Well here were are, 11 messages into the thread and the OP still won't... (by dhayden)
split string S
 
How can I split string S into substring S ? Also substring S should set some number a . Should I u...
[13 replies] Last: cut one segment into two and pay for this a price equal to its length ... (by jonnin)
Converting struct to class? xxx is private within this context
 
Not sure how to alleviate this issue (see title). I went ahead and was in the process (not finished ...
[3 replies] Last: If the 0-arg Product constructor must be private, then don't call it. ... (by Ganado)
How to access instance variable value?
 
I created n objects from the Stock class and assigned a value for the integer instance variable expe...
[6 replies] Last: vector<Stock> shares( n ); ... ... sort( shares.begin(), shares.end()... (by lastchance)
by CVRIV
Having trouble comparing \r and \n from a text file.
 
I'm having the weirdest issue. I'm trying to count characters in a text file, while excluding \r...
[2 replies] Last: Yea.... I figured this out hours ago. I should of deleted this thread ... (by CVRIV)
Nested class/Double-linked list confusion
 
Hi everyone, we were provided all the following code and told to write the addLongInt() function. We...
[7 replies] Last: There is still a lot I have to learn. Compare your approach to my c... (by seeplus)
Do custom allocator apply just to containers, and how do i apply them to any memory allocation
 
https://en.cppreference.com/w/cpp/named_req/Allocator I am referring to this ^^^^ kinds of custom...
[6 replies] Last: There's no point in aligning the vector. (by mbozzi)
Log File Wrap Over Failing
 
Hi All, I'm having an issue with my app at midnight when it's meant to start writing to a new log f...
[6 replies] Last: GCC, for instance, will only warn on shadowing if you explicitly enab... (by MikeyBoy)
destructor called after calling constructor
 
By looking at the example: #include <iostream> int wow=0; class Foo{ int cow = 0; public: Foo...
[7 replies] Last: Okay I already get it. Thanks for your help. (by mjjm1442)
Array of Structures Memory Issue
 
In my main function, I create an array of structures which stores cache information i.e. dirty bit (...
[2 replies] Last: It would help to see the code that's calling the function. How certai... (by MikeyBoy)
should i use static constexpr instead #define () and naming convection (1,2)
 
in good old c we used to just have #define SOME_GLOB_CONSTANT 5 but now days we also have co...
[30 replies] Last: Experimenting is fine. There's lots of existing code that uses macros ... (by seeplus)
for loop question
 
hi , so this is the question just very confused how to start and end , also please explain me what e...
[7 replies] Last: try to break it down into something simpler that is easy to do. This... (by keskiverto)
by RicoJ
"Empty" std::thread is not moved properly?
 
Here by "empty std::thread" means a std::thread object with "no thread of execution" According to c...
[3 replies] Last: Hi guys, What is the point of your code? Why are you trying to mov... (by RicoJ)
configuring compilers
 
I've installed Codeblocks and tried to configure the mingw compiler that I downloaded.. But codebloc...
[2 replies] Last: There is a C::B download that has a C/C++ compiler already set up for ... (by Furry Guy)
std::priority_queue<std::vector> how to reserve space in the internal vector container
 
I am trying to performance optimize some code and I want to observe the effect of reserving space on...
[4 replies] Last: I ended up going with boost::heap::priority_queue which (at least for ... (by Kallinteris Andreas)
April 2021 Pages: 123... 8
  Archived months: [mar2021]

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