General C++ Programming - October 2023

Not sure if I got this right
 
Hi, Here is my assignment question: C++ Program Write a program that adds the positive odd num...
[17 replies] Last: Oh, something to remember. You know what the code is supposed to do... (by George PlusPlus)
question about hand-over-hand fine-grained locking mechanism
 
hello everyone...probably this is my first post here so CMIIW...btw currently I have a problem regar...
[12 replies] Last: node<T>* succ = first; std::unique_lock<std::mutex> current... (by seeplus)
Stuck again and need help
 
I cannot get the code button to work. HI, This is my assignment. <You are writing a program t...
[9 replies] Last: So I think that I need setw(30) With cout, setw() affects what come... (by seeplus)
I'm stuck with an odd error message
 
Here is my code there is not much to it. I am supposed to write some code to go from 1 to 10 and eac...
[8 replies] Last: The code as originally posted only while looped on total = seven + 3;... (by George PlusPlus)
Lock
 
I have an issue which for simplicity comes down to this: void process(int n) { // Do proc...
[6 replies] Last: If you want to stay cross-platform and still support Win32, have a loo... (by kigar64551)
by Cplusc
Unix transcript of build event
 
I've successfully developed a C++ code using Visual Studio on Windows, and my current task involves ...
[9 replies] Last: POSIX API (i.e. <unistd.h>), which I wouldn't call "non-standard" I... (by seeplus)
I'm in school and stuck trying to go from a double to an integer
 
Hi All, I am taking a course in c++ and doing an assignment. I have to post the whole code I have r...
[7 replies] Last: @mathman54. Please don't post line numbers as part of the code. It mak... (by seeplus)
Format woes
 
int main() { std::cout << std::format("{:< 8f}", .111111); } displays 0.111111 but I ne...
[9 replies] Last: std::cout << s.substr(*s.c_str() == '0'); (by mbozzi)
adding chrono::months to a sys_days
 
Trying to add 1 month to today does not yield a sys_days!!! chrono::sys_days today = getToday(...
[4 replies] Last: Trying to add 1 month to today does not yield a sys_days!!! Well my... (by seeplus)
by helios
Apparently this is valid
 
I just noticed I had this somewhere without realizing. void foo(); void bar(){ return fo...
[1 reply] : Definitely just *looks* like an unintentional bug from a programmer, a... (by Ganado)
by Cplusc
Line box intersection
 
I am casting a line from any arbitrary point in a 3D space and I want to check if the line intersect...
[1 reply] : Now is a great time to do some debugging, with a debugger :+) Actuall... (by TheIdeasMan)
Calling C++ method pointers
 
I'm having a problem trying to a C++ method pointer. There' lots of examples on the net of using ...
[1 reply] : Line 53 should be: if (! (this->*fp)(str)) // Do the... (by mbozzi)
literal for one day
 
Hi, I have: time_point<system_clock> tp; tp += days{ 1 } + 23h + 55min; // days{1} + hour...
[5 replies] Last: @George P day (of month) exists but day s (duration) does not exist ... (by coder777)
by Cplusc
MPI Data Type
 
I am trying to broadcast a used-defined data(boundingbox) but unfortunately, the data differ in diff...
[2 replies] Last: Thanks, you are right. (by Cplusc)
64 bit architecture and programming
 
Hi guys, So I'm not sure if this belongs in the longue, but it does pertain to programming and pote...
[14 replies] Last: Right, well in that case an example of working with the branch predi... (by Ganado)
by Runsva
Call Function in DLL from C++ Program?
 
I'm attempting to call a function inside a shared library DLL file using a C++ program. I'm using C+...
[13 replies] Last: The difference between _cdecl and _stdcall is going to determine which... (by seeplus)
by Runsva
Include Mutex when building with G++ via Command Prompt?
 
I want to compile a C++ program that includes & uses the mutex library, with G++ via the Command Pro...
[3 replies] Last: Looking to compile on a Windows system there are several newer options... (by George PlusPlus)
When to choose Args&& instead of Args?
 
Hi, I have a simple question. When do we choose this implementation: template<class... Args...
[2 replies] Last: You use std::forward with && for perfect forwarding. As the type of Ar... (by seeplus)
how to send output to console when using catch2 for C++
 
Hi, I have a console project that links with catch2 libraries but I can't see the output in the c...
[no replies]
by Runsva
Build Shared Library File from String of Code?
 
Suppose I have a C++ code excerpt literal saved in a std::string variable, as such: #include <i...
[2 replies] Last: You can not just "save" the C/C++ code to a DLL file. That is becaus... (by kigar64551)
  Archived months: [sep2023] [nov2023]

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