• Forum
  • General C++ Programming

General C++ Programming

by admin
Welcome to this board!
 
Welcome to the general programming forum in C++.com! In this forum, users can to talk about any topic related to programming in the C++ language that does not ...
[no replies]
by Cplusc
MPI Blocking and Non_Blocking Communication
 
I'm currently working on a lattice Boltzmann code (D3Q27) employing MPI for parallelization. I've implemented MPI 3D topology for communication, and my code sni...
[5 replies] Last: @mbozzi that a process to the right of a sender should receive from ... (by Cplusc)
by Cplusc
DFS and DLS Algorithm
 
I am supposed to write a C++ code to answer the following questions but before that I need to be able to answer the questions on paper to write the correct code...
[14 replies] Last: Heh, glad I’ve been of use to you. :O) A large part of my degree wa... (by Duthomhas)
what is the epoch of pseudo-clock local_t?
 
I created an empty time point that represents epoch time: auto tse = chr::time_point<chrono::local_t, chrono::duration<int, ratio<1, 1>>>{}; what da...
[2 replies] Last: Internally, tse stores a duration since the Unix epoch. https://st... (by mbozzi)
by Cplusc
BSF Algorithm
 
An undirected graph has 24 vertices denoted by A’, B,’ C’, D’, E’, F’, G’, H’, I’, J’, K’, L’, M’, N’, P’, Q’, R’, S’, T’,...
[2 replies] Last: @Keskiverto Thanks for the answer. (by Cplusc)
Can you give me an example of parametric polymorphism
 
Hi, I need a few examples of parametric polymorphism please. Regards, Juan Dent
[1 reply] : Here's what CoPilot has to say: Certainly! In C++, parametric polymo... (by AbstractionAnon)
why does this lambda expression not work
 
following the book C++ Template Metaprogramming I find the following lambda expression that does not do what it's supposed to: using argument_types = mpl:...
[2 replies] Last: Thanks!! That's it! (by JUANDENT)
operator<=> implementation is correct?
 
Hi, It is not clear to me how to implement the <=> operator. As an example let's look at a type: struct Integer { int i; long j; explicit Inte...
[3 replies] Last: Have a look at: https://www.modernescpp.com/index.php/the-autogenerate... (by seeplus)
boolean test
 
For bool b, is the test if (b) slightly faster than if (!b)? For example, should I change code if (!b) do_a(); else do_b(); into if (b) do_b(); else...
[8 replies] Last: I don't think we can say in general which is "faster". If there is an... (by mbozzi)
How to get std::priority_queue to update dynamically when element priorities change?
 
Suppose you have a custom type, Foo , whose Num member is used to determine priority in a priority_queue: struct Foo { string Name = ""; int...
[4 replies] Last: what you are talking about is a sorted container that is smart enough ... (by jonnin)
run tasklist in c++
 
Is there a function in C PLUS Plus to know which programs are running on the other user? like this: tasklist /FI "IMAGENAME eq notbad.exe" /FI "USERNAME eq HWL...
[6 replies] Last: thanks all so much , solved (by Hawlong)
Need Help with C++ Basics!
 
Have a look at this site: https://www.learncpp.com/ For a book I suggest Ivor Horton's 'Beginning C++23: From beginner to pro' https://www.amazon.co.uk/Beginn...
[4 replies] Last: Back in the 1980's all of the McDonald's on Oahu had Portuguese Sausag... (by George P)
convert autoit code to c++
 
hello all , please how can convert this code to c++ What this code does is when I go to another user in Windows, this program conn.exe runs . #include <WinA...
[2 replies] Last: Thanks for replay jonnin i have 10 users in my pc ,i created a progra... (by Hawlong)
Turn-based Card Game Feature: Out-of-turn Trade Request
 
Just FYI, I haven't written any code for the game. I'm in the planning phase, brainstorming how certain game features might affect the structure/architecture of...
[2 replies] Last: As I see it, you have three choices ( order of difficulty) 1) The si... (by AbstractionAnon)
by PeteDD
Constructor for derived class
 
I am adding some methods to the NTPClient by creating a derived class MyNTP. But now, I can't figure out how to invoke the new class. That is, I can't figur...
[11 replies] Last: Thank you all! @SeePlus, Yes, exactly, thank you! But what you're ... (by PeteDD)
by PeteDD
Adding methods to class via derived class
 
I am using an NTPClient and want to add a few methods to its functionality. I have no difficulty going into the source of the client and, for example, adding t...
[1 reply] : solved... but only in part... added "MyNTP::" in .cpp String MyNTP... (by PeteDD)
Convert string_view to string ref
 
As a simple test case for much larger code, I want to pass std::string_view as a param to a function taking an arg of const std::string&. This isn't accepted wi...
[3 replies] Last: Elwood P. Dowd is on stand-by. (by George P)
Threading implementation using setjmp.h
 
Hi guys, A little bit of preamble will help me segue into the topic at hand. I've been using chatGPT quite often over the past 4-6 weeks. Although not always...
[12 replies] Last: If the I/O thread makes an I/O request via a system call such as writ... (by AbstractionAnon)
by Cplusc
Reading PNG file
 
I am utilizing the OpenCV library to read a PNG file and successfully visualize it. The PNG file represents three distinct datasets: Raw MRI (depicted by a gray...
[2 replies] Last: The PNG file has also gone. (by salem c)
Not sure if I got this right
 
Hi, Here is my assignment question: C++ Program Write a program that adds the positive odd numbers you enter from the keyboard while ignoring the even n...
[17 replies] Last: Oh, something to remember. You know what the code is supposed to do... (by George P)
  Archived months: [dec2023]