Does
#include <iostream>
using namespace std;
int main()
{
float* temps = new float[10];
float* temps2 = temps;
delete[] temps2;
return 0;
}
have the same working as
#include <iostream>
using namespace std;
int main()
{
float* temps = new float[10];
float* temps2 = temps;
delete[] temps;
return 0;
}
?
Do they both release all the allocated memory? Or do I have to delete[] the original pointer?