General C++ Programming - March 2022 (Page 6)

Need urgent help with C++ solution
 
I am trying to solve this problem in C++. JAVA code is given in the below link, but I don't understand JAVA. Need to store and check if total of any 3 elements ...
[13 replies] Last: Thanks everyone for all your valuable inputs. (by leo2008)
by frek
Unit test and performance measurement
 
Hi all, 1) Is there any (free) tool to measure code performance or time complexity of it on Visual Studio 2022, please? 2) Among GUnit and CPPUnit, which d...
[2 replies] Last: For unit test, I really like CATCH2 and I use it in every my projects. (by wqking)
by Cplusc
problem when moving from 32 to 64 platform (1,2,3,4)
 
I'm having difficulties when changing from 32 to 64. every single line of the code gives me an error. for example the following function works well in 32 but fo...
[60 replies] Last: @TheIdeasMan, That code example you used from cppreference. https://... (by deleted account xyzzy)
by helios
Weird name resolution
 
Given: class Entry{ protected: virtual void to_DirectoryEntry(DirectoryEntry &) const = 0; public: DirectoryEntry to_DirectoryEntry() const; }; class...
[3 replies] Last: Ugh. So dumb. Yeah, now I remember. I've done this at least once befor... (by helios)
by pejvak
make a template class a friend of two class
 
Imagine we have three template classes. The second class `B` should access private member of class `A` and class `C` should access private members of both class...
[5 replies] Last: It seemed to work when I tried... Please post an example of accessing ... (by Peter87)
How Do I Fix comparison between signed and unsigned integer expressions
 
I get this warning when i try to run my program: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] This is the part...
[3 replies] Last: The problem is that comparisons with signed and unsigned integers (whe... (by Peter87)
Overloading Output for a pointer to an array in a class
 
Hello all, I have been trying to write a class that can handle bigInts (up to 40 digits long stored in a dynamic array of shorts) but I am having trouble overl...
[1 reply] : Addition is usually implemented as N carry = 0; for i = (least signi... (by helios)
Is there an issue in my Code
 
I am having an issue with some parts of my code: #include <iostream> #include<cmath> using namespace std; int main() { //DATA ABSTRACTION: ...
[5 replies] Last: ok i fixed the issue in line 18. #include <iostream> #include<cmath... (by DeezyM89)
Char array to int avoiding dynamic memory allocation
 
Hi, I realise that the topic of char to int has been covered quite extensively in a number of posts but I can't see anything which discusses the conversion of ...
[1 reply] : Consider std::from_chars https://en.cppreference.com/w/cpp/utility/f... (by mbozzi)
using coroutines to solve stack over flow due to deep recursive function call
 
hi, is there any one who has experience/advices on if and how we can solve the stack overflow issue due to deep recursive function call using coroutines? is ...
[4 replies] Last: Some other things to try: - Increase the stack size. This is usually a... (by dhayden)
by JB71
Random Number Generator (1,2,3)
 
Hello all, I am a total noob when it comes to programming, and I am stuck on a problem that I have worked on for a few hours now. Basically, I need to write a C...
[46 replies] Last: Interestingly while mucking around with VS, doing some testing with <r... (by deleted account xyzzy)
by frek
Volatile and threads
 
Hi all, My first question is how to recognize a section in the project's code in which some variable(s) may be optimized away by the compiler that we don't wis...
[6 replies] Last: @helios. Thank you, two great points! (Especially portability). Thank ... (by frek)
how change the Pointer size inside the function?
 
see these function that have an argument Pointer: void GetDIBs(BYTE *Pixels) { int dwLen = bmi.bmiHeader.biWidth *bmi.bmiHeader.biHeight * (BitM...
[5 replies] Last: thank you so much. works fine. and i tested that must be: "pointer adr... (by Cambalinho)
blank
 
blank
[4 replies] Last: Your're genuinely a life-savior @mbozzi, thank you, your credentials a... (by Axon727)
Task
 
Hi, I'd like you to help me with my school task. I've got some code, but it's too slow. Here it is: #include <iostream> using namespace std; bool T ; int mai...
[10 replies] Last: Thanks! It works. Yeah, the problem with my code was that I didn't mak... (by algmaster)
How to find how many instances of templates are created upon compilation
 
Hi, I have this code and want to find how many instances of templates are generated: template<size_t A> struct Wrap_ { template<size_t ID, typen...
[2 replies] Last: C++ Insights (after fixing the compile time errors) can show template ... (by JLBorges)
by wqking
ANN: accessorpp -- open source C++ library for data binding and property
 
ANN: accessorpp -- open source C++ library for data binding and property https://github.com/wqking/accessorpp I appreciate if you can give your opinions, revi...
[4 replies] Last: What about the castings on line 16/18 in 'Customized getter/setter' a... (by wqking)
how create a GDIPlus Image from HBITMAP?
 
how create a GDIPlus Image from HBITMAP? void NewImage(int Width, int Height) { if(ImageWidth==0) Dispose(); ImageWidth=Width; ...
[1 reply] : the problem is the Pallet? Maybe not. The problem might be line 15. T... (by coder777)
Overloading Output for a pointer to an array in a class
 
Hey yall, so I have once again stumbled upon an overloading problem. For this class project, we pretty much have to make a class for a type that handles extra l...
[4 replies] Last: numSize is a member of my class but it had to be static and initializ... (by AbstractionAnon)
how get pixels colors from HDC?
 
how get pixels colors from HDC? void GetPixelsFromHDC(HDC Destination, int *pixels) { //Get the HBITMAP from HDC: HBITMAP hBitmap = (HBITMAP)GetCurrent...
[16 replies] Last: the answer is YES. thanks for all (by Cambalinho)
March 2022 Pages: 1... 4567
  Archived months: [feb2022] [apr2022]

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