will this clear the memory when it terminates:
compared to this? :Code:// type 1
int main(void)
{
char x = 'x';
return 0;
}
which one is more memory efficient? for type 1, will the memory be automatically cleared after execution or will type 2 do a better job or are they both the same? will type 2 cost less memory?Code:/ type 2
int main(void)
{
char *x = new char[1];
x = 'x';
delete [] x;
