I am relatively new to C++ and trying to figure out how to properly delete structures. I understand that the delete operator should only be used on pointers created using the new operator.
However, in the context of structures and particularly when used within a binary tree, I have now often seen something like:
struct test_structure {
int test_content;
};
test_structure *test_realization;
// Some code
delete test_realization;
I do not quite understand why this is okay, even though no new operator was used to create test_realization. Or am I missing something here?