On Sunday, 21 July 2024 at 15:31:47 UTC, Johan wrote:
On Sunday, 21 July 2024 at 13:35:46 UTC, Troy wrote:
void create(void* b) {
std::string s = "engineer again";
*(std::string*)(b) = s;// Segfault here
}
You have to construct an empty string object first in location
`b` (em
On Sunday, 21 July 2024 at 13:35:46 UTC, Troy wrote:
void create(void* b) {
std::string s = "engineer again";
*(std::string*)(b) = s;// Segfault here
}
You have to construct an empty string object first in location
`b` (emplacement new). Then you can assign to it as you do.
Th