My question is one concerning memory allocation in C++
Say you declared a variable -
int p = 5;
The compiler allocates bytes in memory for data type integer; but does it automatically free that memory after the program is done, or do you have to use the new and delete operators for every variable you declare?
My main concern is: how do you manage memory in C++, and how much is automatic or up to you?
Say you declared a variable -
int p = 5;
The compiler allocates bytes in memory for data type integer; but does it automatically free that memory after the program is done, or do you have to use the new and delete operators for every variable you declare?
My main concern is: how do you manage memory in C++, and how much is automatic or up to you?