General C++ Programming - December 2022

scrollbar api32
hallo c puls plus (ers) the scrollbar wand moves the value. do i need to set a int ? HWND Scrollbar = CreateWindow(TEXT("scrollbar"), NULL, WS_CHILD | ...
[2 replies] Last: he newbieg, i used the example form the link but the SCROLLBAR stil... (by nvthielen)
Function consolidation
I'm severely suffering from the 'morning after the night before' syndrome and have even trouble using a keyboard! I knew it was a mistake having it during the w...
[7 replies] Last: Two overloads: #include <iostream> #include <string> #include <strin... (by JLBorges)
can i create my own array type?
i need create a especific array type: Matrix4X4. but is like: float ProjectionMatrix ; can i create a type, using typedef or something, for what i need? so...
[4 replies] Last: The 'typedef' and 'using' do not create "new type"; they define an al... (by keskiverto)
can we use vectors in compile time programming?
Hi, We can program with complex numbers during compile time like this: constexpr complex conc{ 7.88 }; constexpr complex s{ 5.91 }; constexpr auto t ...
[6 replies] Last: > no way to construct a std::vector at compile time and make it surviv... (by JLBorges)
by Mobo01
How to determine the greatest sum of the smallest and second smallest items from all available subarrays
Find the largest sum of the lowest and second smallest items in an array from all available subarrays. In more technical terms, if we write all (nC2) subarrays ...
[5 replies] Last: Huh, craftier than the usual POS bots. Thanks for the heads up. (by Ganado)
why can an xvalue be an glvalue or a rvalue in C++17?
an xvalue is an expiring rvalue at the right side of an assignment. in which circumstance is an xvalue a glvalue? can we place an xvalue on the left side of an ...
[10 replies] Last: There seems to be a difference between the built-in assignment operat... (by mbozzi)
Ulam conjecture (1,2)
Hello, I have a problem. I have to find a starting number (under 10^18) based on the length of the sequence (it is a collatz problem where from the starting num...
[21 replies] Last: It's a frustrating problem: it's still a little arbitrary how many can... (by lastchance)
Initialize const with sum of array
Hi, I want to initialize a constant (TOTAL) as follows: const int N = 2; const int MY_ARR {3,4}; const int TOTAL = std::accumulate(MY_ARR, MY_ARR + N, 0...
[6 replies] Last: Ganado What you can't do, however, is then use the result of TOTAL... (by Alejandro Antonio)
how use multithread inside a class? (1,2,3)
i have the 'image' class.inside the class i have these function: void DrawLine3D(Position3D Origin, Position3D Destination, COLORREF LineColor=RGB(255,255,255)...
[52 replies] Last: i just need calculate the perspective on Start and the End line posit... (by coder777)
by Cplusc
reading txt file
I am trying to read a txt file line by line but I don't understand why my code can not open the txt file. mesh.h class Mesh { public: size_t nLattice_; Ve...
[13 replies] Last: [quote=Cplusc] visual studio 2022 Visual Studio is notorious for havi... (by George P)
by Cplusc
shared pointer
I have a class as follows class Node:protected Model { public: int sizeofneighbour; VecDbl_t distributions_; VecDbl_t newDistributions_; std::shared_ptr...
[2 replies] Last: @Peter87 Thanks for your answer. (by Cplusc)
How to call a function inside a struct
Hello all , i found this code online But I don't understand it. Please explain this struct inside the class (I am a beginner) Artifacts.h class Artifacts {...
[10 replies] Last: Thanks so much seeplus, MikeyBoy, kigar64551 I understand. Thank you... (by Hawlong)
Linking OnClick from data <xml>
I have created a small xml parser/encoder library that I call smollXML. Both the server program (the one generating the xml data) and the client program must ...
[7 replies] Last: [quote=seeplus]Note that #pragma weak isn't supported by VS IIRC "#p... (by George P)
Colour glitch in code.
Hi, I am getting some inconsistency in colour values. I am getting a strange glitch in my code. I have unsigned char red = { 255, 53, 59, 154, 0, 25...
[15 replies] Last: (by salem c)
get Elements of Recursion step-wise
Hello all, i cant figute out how to make my code work the way i want it to. make() gets me all the combination with a string of length k using a specific datas...
[6 replies] Last: Thank you anyways. I worked out a even faster way to achieve so, and p... (by LukeProducts)
by helios
Hacking member accessibility
I'm working on a second version of my serializer. I want to be able to de/serialize some classes that I don't have control over. For example, class Foo{ ...
[12 replies] Last: I mean, that's just sensible IMO. That rule made no sense. (by helios)
Combining 2 bits to get a single integer value
Hi, I am trying to combine two binary numbers. For example if I have a binary value of 1 and a binary value of 1. I want an integer value of 2. I was told to ...
[11 replies] Last: Thanks Peter. I am gradually learning. Got it figured out somewhat. (by Cyclone)
Confused on how to continue the rest of the code
I need to add a code that allows the user to type in any number from 1 to 10 and it will print how many times that number is in the array. I don't know how to g...
[4 replies] Last: Also, if you do need/want the array, you can print the random numbers ... (by seeplus)
  Archived months: [nov2022] [jan2023]

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