Searched for a while, but I can’t figure out why this would raise a bus error.
Any help would be much appreciated.
typedef struct { set<int> pages; } someStruct; ... void someFunction() { ... someStruct *a = createSomeStruct(); // just mallocs and returns a->pages.insert(5); ... }
malloc doesn’t initialize the memory it allocates. try with new.