View Single Post
Old 04 January 2021, 10:27   #15
Ernst Blofeld
<optimized out>
 
Ernst Blofeld's Avatar
 
Join Date: Sep 2020
Location: <optimized out>
Posts: 321
Quote:
Originally Posted by Emufr3ak View Post
Can I have a look at yours Ernst.
Here's my main.cpp:

Code:
#include "support/gcc8_c_support.h"
#include <exec/execbase.h>

struct ExecBase * SysBase;

class TestClass {
    public:
        TestClass(int a);
        ~TestClass();

        void Test();
    
    private:
        int a;
};

TestClass::TestClass(int aa) {
    KPrintF("In TestClass::TestClass(int)");
    a = aa;
}

TestClass::~TestClass() {
    KPrintF("In TestClass::~TestClass()");
}

void TestClass::Test() {
    KPrintF("In TestClass::Test, a = %ld", a);
}

int main() {
    SysBase = *((struct ExecBase * *) 4UL);

    KPrintF("In main()");

    TestClass test1 = TestClass(1);
    test1.Test();

    TestClass * test2 = new TestClass(2);
    test2->Test();
    delete test2;
}
Ernst Blofeld is offline  
 
Page generated in 0.04296 seconds with 11 queries