General C++ Programming - April 2023

Eigen library - references
Hello I am using the Eigen library. I have a 4x3 matrix of doubles and would like to obtain a reference to a row or column of the matrix (so that changes to t...
Apr 29, 2023 at 11:10pm
[4 replies] Last: See the documentation about working with block matrices: https://eigen... (by mbozzi)
akgorithm to order modules according to dependencies
Hi, i have a program that reads module interface units and stores each module's dependencies, like this pseudo code: module A, imports B,C,D module B, imports...
Apr 27, 2023 at 9:01pm
[2 replies] Last: The relevant search term is "topological sorting" You could do someth... (by mbozzi)
by Weasel
undefined reference
Hello, I've been reading Professional C++ by Marc Gregoire and I'm having problems with some of his code. Here is the code of three files I have taken fro...
Apr 25, 2023 at 4:32pm
[2 replies] Last: Keep in mind that the header file ( .h ) only contains the declaratio... (by kigar64551)
dbase
Does c++ have a dbase lib that will be there out of the box? I am trying to use SGLAPI without any success. Am also using code::blocks without much success.
Apr 25, 2023 at 5:22am
[5 replies] Last: In addition to the include path you need also the library. See this: ... (by coder777)
by cgm2k7
Sprite sheet animation calculation
Good afternoon! I'm creating a small 2d game in directx11, I'm trying to animate the sprites. See my doubt: I have a sprite sheet with 18 frames, 3 rows with...
Apr 23, 2023 at 12:51pm
[2 replies] Last: I already managed to solve. m_vertices .uv.x = (currentFrame ... (by cgm2k7)
Random probability
I have this pseudo-code (NOT c c/++) k = 0 b = 0 for i = 1 to 64 r = rnd() if r > .96 then b = b + 1 if r > .98 then k = k + 3 else if r...
Apr 19, 2023 at 8:32pm
[4 replies] Last: Actually, it can be done using the multinomial distribution - see http... (by lastchance)
Scaling a variable by percentage forth and back
Hello guys, even though this is about windows programing, my problem is actually math in relation to DPI aware program, so I'm posting here rather than in windo...
Apr 19, 2023 at 1:27pm
[4 replies] Last: You're right, I gave up from scaling and will continue to use variable... (by malibor)
unmangling C++ unresolved external
Hi, I have a project that upon compiling gives me an unresolved external error with a monstrous name mangling (using VS2022 Preview 17.6 Preview 3 Is ther...
Apr 18, 2023 at 10:18pm
[3 replies] Last: the method in error seems to be sync_table correct? correct... (by kbw)
Force this C++ Programs to use Windows Console Host NOT default Windows Terminal
I have some programs that require MANY changes to use Windows Terminal mode of of console display. Is there a way to force my programs to use the OLD cmd.exe (...
Apr 18, 2023 at 1:52am
[3 replies] Last: Thanks I tried your way (conhost.exe cmd.exe) and it works calling cm... (by tigerlcf)
by frek
Assign to a specific memory address
Suppose some address like 0x25D4C3FA is available on my memory. I want to assign to that address. One way that firstly comes to mind is like: int* p = (int*) ...
Apr 17, 2023 at 1:08pm
[16 replies] Last: Thanks for the link. Do you have a platform-independent link to sugge... (by kigar64551)
by helios
resvg
https://github.com/RazrFalcon/resvg Finally, an SVG rendering library that's actually usable on Windows. It builds in seconds and the code to render looks like...
Apr 16, 2023 at 10:39pm
[no replies]
unresolved external from library containing many templates and many C++20 modules!
Hi, I have a library composed of many C++20 modules and when I link with it in an executable I get unresolved external...why? I am using VS2022 latest Pre...
Apr 16, 2023 at 2:21am
[1 reply] : Not enough information in your post to give you a meaningful response.... (by AbstractionAnon)
class template has already been defined!!
Hi, I have a static library made up of many C++20 modules and many of them #include <system_error> in the section between module and export module, like this: ...
Apr 15, 2023 at 6:05pm
[no replies]
by jonnin
little help playing with concept and templates
I have this toy that is trying to conditionally inherit different base classes to change the behavior of get value. That may not be the best plan here anyway(o...
Apr 14, 2023 at 6:28pm
[5 replies] Last: thx again! (by jonnin)
Optimization using OpenMP: Parallel code is slow
I have a made a post in the past about optimization and parallelization where I got lots of help and feedback. I am attempting to use openMP with FFTW library a...
Apr 14, 2023 at 2:34am
[12 replies] Last: But if I run with openMP and FFTW following the instructions: https://... (by JamieAl)
vector multi template argument
what multi template argument in vector seen eg. std::vector<_Tp, _Alloc>::reference
Apr 13, 2023 at 5:11pm
[1 reply] : https://cplusplus.com/reference/vector/vector/ _Tp is the data type o... (by doug4)
Is it possible to access a non exported item from another translation unit?
I have a definition of a function called Mem() inside a C++ 20 module but not exported. I need to access Mem() from another translation unit in the project. Is ...
Apr 10, 2023 at 5:08pm
[no replies]
by Cplusc
Octree data structure method
Can anyone tell my why I'm getting out of subscription error for blockIndices? This code reads the triangulation of the surface of a volume and uses Octree meth...
Apr 8, 2023 at 2:14am
[3 replies] Last: ok, and what does it do in generate hex mesh? you just say main doesn... (by jonnin)
how to get local hh_mm_ss for current local time?
Hi, I need a local now point that will give me current time zone values. For instance if i am in Kansas, the local time would be the value of GMT-6. Using sy...
Apr 6, 2023 at 6:29am
[2 replies] Last: // C++20 #include <iostream> #include <chrono> int main() { // ... (by JLBorges)
equal_range question
I'm using a multimap to store a collection of PLAY objects. The multimap entries consist of a score (int) and a copy of the PLAY object. I'm stuck in two pl...
Apr 5, 2023 at 9:33am
[3 replies] Last: Consider something like this - where the map is sorted descending rath... (by seeplus)
April 2023 Pages: 12
  Archived months: [mar2023] [may2023]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.