Code:/*-----class1.cpp-----*/ #include <stdio.h> class Sample { public: int a, b; void fonk(void); }; void main(void) { Sample t; Sample* T=new Sample(); t.a; T->a; }
What are the differences between t and tnew?
I heard that t is located in stack but tnew is located in heap.Is this true or enough?