General C++ Programming - November 2024

Making a shared_ptr out of a stack object corrupts the heap!!
 
Hi, The following code is incorrect: Customer customer = { 0, "John Doe", "[email protected]" }; auto cc = std::make_shared<Customer>(customer);...
[2 replies] Last: Note: std::make_shared<T>() creates a new heap-allocated instance of... (by kigar64551)
Testing restart functionality in C/C++
 
Hello! I am trying to implement "restart" functionality in my code, where if for some reason the code stops (i.e. iterations drop) I can pick up from where I s...
[1 reply] : you will get more help if you put it in a repo where we can see the co... (by jonnin)
Need a data structure where I can map a string to a type
 
Hi, Need a certain compile time map m like this: using Type = typename m["Customer"]::type; // Type would be Customer How can i do this? Regar...
[10 replies] Last: It's not necessary to use an enum. It was just a suggestion. (by Peter87)
Save to file with vector (dynamically)
 
I have created a programme that does calculations and generates results from those calculations. The imformation generated is stored in variables for later d...
[11 replies] Last: i outside the loop is not a c++ error. It is a questionable programmi... (by jonnin)
  Archived months: [oct2024]

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