new or new []
delete or delete []
new there should be a corresponding delete
type * identifier
& identifier
*identifier to get to an entire thing.
identifier->member to the member of a structure or class.
FooT * a;
a = new FooT;
// no delete follows
...
a = new FooT;
void Fun1(FooT * param) {
FooT * b;
b = param;
...
delete b;
return;
}
int main() {
FooT a = new FooT;
Fun1(a);
delete a;
return 0;
}
FooT & operator = (FooT & src) {
if (this != &src)
// delete current memory
// copy others
}
return *this;
}