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...
[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...
[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...
[2 replies] Last: Keep in mind that the header file ( .h ) only contains the declaratio... (by kigar64551)
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.
[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...
[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...
[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...
[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...
[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 (...
[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*) ...
[16 replies] Last: Thanks for the link. Do you have a platform-independent link to sugge... (by kigar64551)
by helios
resvg Finally, an SVG rendering library that's actually usable on Windows. It builds in seconds and the code to render looks like...
[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...
[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: ...
[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...
[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...
[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
[1 reply] : _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 ...
[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...
[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...
[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...
[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.