[Solved] Memory Leak in Struct C++ [closed]
[ad_1] First, your code won’t compile with the stray “struct” in there. Deleting that, we can answer your question: it depends how the parameter was allocated, but in any case you should only do it once. int main() { int a[] = { 1, 1, 1 }; int i = 42; int* pi1 = &i; … Read more