General C++ Programming - November 2022

Comparing two .txt files
 
It has been a while since I have done any programming in anything other than G code since I have been working as a machine shop engineer. I need to perform a s...
[11 replies] Last: Or this one which concatenate strings - 3 words for an entry in the ve... (by Geckoo)
typename as a type template parameter
 
What does "typename = ..." mean in the code below? Is it a type template parameter? but it evaluates to void if T is an array?? template<class T, typena...
[2 replies] Last: Just a small further point. You can use typename instead of class in t... (by seeplus)
is there any bias random number generator in c+++
 
Is there Bias random number generator to use in c++ that can skew the generated numbers towards one end? for e.g. If I generate 100 random numbers between...
[14 replies] Last: See https://en.wikipedia.org/wiki/Chebyshev%27s_inequality particularl... (by lastchance)
why these 'if' seems ignored? (1,2,3)
 
see these code: void DrawLine(int X0, int Y0, int Z0, int X1, int Y1, int Z1, COLORREF LineColor = RGB(255,0,0), bool Refresh=true) { //Getting ...
[43 replies] Last: yes.... i'm doing another test.. maybe i can win much more speed. i'm ... (by Cambalinho)
How do I bypass a Segmentation fault?
 
Hey guys. So I've been programming in C++ for a few months now, and I've been enjoying it all the way through. This is my first time using a programming lan...
[4 replies] Last: > and I'm currently trying to do this problem: ... > everything works ... (by salem c)
How to read text from a eax
 
i make hook by c++ to copy string from eax 0F881E5 | A3 B84C8B0F | mov dword ptr ds:[<void *__ChatMsg>],eax xdb64 dword ptr ds:[0F8B4CB8 &L"xa...
[4 replies] Last: Thanks for answer jonnin , When printing, strange letters appear, know... (by Hawlong)
Stay in file line count?
 
Hello everyone, I have a question for my c++ code. I have an assignment where I get have a file with different expressions to which I have to convert to post, p...
[3 replies] Last: Perhaps something like: #include <fstream> #include <iomanip> #incl... (by seeplus)
Monopoly -- Forum (1,2,3)
 
I'm trying to write snippet code about monopoly and I would like to know what data structures I should use for a playercount function (like choosing between 2-4...
[51 replies] Last: player.cpp #include <iostream> #include <algorithm> #include <vector... (by seeplus)
Viability of Casting `void(*)(int*)` to `void(*)(...)`
 
I was thinking about the std::function<> class and I'm trying to figure out what that would look like in C. So far I got this: typedef struct _StatefulFunc...
[10 replies] Last: That's pretty interesting though it feels weird to identify UB as perm... (by highwayman)
by thmm
std::min with const char *
 
Seems that std::min doesn't work with const char * Has anyone encountered this problem as well ? #include <iostream> #include <algorithm> int main() { ...
[15 replies] Last: I can imagine some legacy code that uses const char*. Yes, old code ... (by jonnin)
by Heiru
Initialize an array of objects and show them on screen
 
Hello. I need to make an array (in the main function) of objects (class Person), initialize them and show them on the screen with the operator in line 129. But ...
[2 replies] Last: Thank you. I wrote the constructors again to be safe and got rid of th... (by Heiru)
Array of multiple types
 
Hello guys, ive written this code: class boundList { struct node{ void *elem{nullptr}; node *next{nullptr}; }; node anchor; node *_Last; public...
[8 replies] Last: If you know types during compile-time, then you know types and can ess... (by keskiverto)
TLV library in C
 
Hello everyone!! Does anyone know about a TLV library in C? I have to write the contents of some buffer into disk using TLV format. Thanks in advance!
[2 replies] Last: Like George, I have not had to use one and cannot recommend one random... (by jonnin)
Optimization with Eigen Tensors and OpenMP
 
I have an older post about optimization with Eigen matrices where answers were EXTREMELY helpful. The thing is the code I used there is a 2D code and the optimi...
[4 replies] Last: @mbozzi Thanks, I am looking at it. Trying to test several things at ... (by JamieAl)
How to add N weeks to a sys_days?
 
I have a starting sys_days called start but need to find the sys_days corresponding to start + N weeks into the future???
[2 replies] Last: thanks!! (by JUANDENT)
A question about virtual function
 
Hello I have a question about virtual function. I have a base class and a derived class below: class Person { public: virtual void eat() = 0; }; class Stud...
[2 replies] Last: Thank you so much!I get it. (by ningfan666)
Help understanding Class Exercise
 
All, being brief as possible, I’m working on an exercise from C++ Primer Plus Sixth Ed. by Stephen Prata. Chapt 10 Ex 6 for those playing along at home. I was...
[4 replies] Last: You may or may not be aware, but in c++, a number of object methods ar... (by jonnin)
by Mobo01
Adding many Python files and directories to a single dmg file
 
How can I make a single dmg file out of many Python files in different folders? I know that's doable for a single file, but how can I do it for several? I can ...
[3 replies] Last: Have you tried turning it off and on again? (by helios)
Any explaining ' following a name?
 
As came across the link below, is anyone very knowledgeable on c++ syntax so explaining the char ' following identifier name (e,g below and following link is th...
[5 replies] Last: I think the OP in that HN thread had rather unusual ideas. It's pretty... (by helios)
Debugging a delete error?
 
I am pretty sure I have some sort of deletion error. How would I go about debugging it? I am still not savvy with using the call stack and finding out what it c...
[9 replies] Last: Sleep tight guys I figured it out. I also had 2 objects in main that w... (by jetm0t0)
November 2022 Pages: 12
  Archived months: [oct2022] [dec2022]

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