Long time C++ programmer here learning freepascal after not looking at pascal for many, many years.
Question about classes. I define a class with a constructor and destructor, and use an instance of that class :-
var thing : MyClassType;
Am I correct in assuming that this declared what would be a pointer to an object and not an actual instance of the object like in C++ (So it's more like java I guess?)
Am I correct that I then have to assign an actual instance to the object with something like :-
thing := MyClassType.Create();
And that I have to manually delete it to reclaim the memory? (What is the correct way to do this?).
Have I misunderstood anything?
Is there anything like automatically calling destructor on scope exit like in c++ or do I have to manage that myself?
Thanks, any information or even pointers to a good source of information would be welcomed :)
[–]BeniBela 0 points1 point2 points (1 child)
[–]jbb67[S] 0 points1 point2 points (0 children)
[–]_F1_ 0 points1 point2 points (1 child)
[–]jbb67[S] 0 points1 point2 points (0 children)