Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6977

C/C++ • Call Class overload from another Class that has been made Public. New to c++!

$
0
0
I want to overload this class within another class

Code:

    class CTask    {    public:       uint16_t m_task_priority = 5;    uint16_t m_task_core = 0;    uint32_t m_nStackSize;    /* overload function    CTask(uint8_t core, uint32_t stack_size) :    m_task_core (core),    m_nStackSize (stack_size){        }       }
From within this class:

Code:

    class CLEDTask : public CTask    {    public:            /* overload here */    CLEDTask (CActLED *pActLED):CTask((uint8_t)1, (uint32_t)65535) { };    ~CLEDTask (void);void Run (void);    private:    CActLED *m_pActLED;    };
Specifically,

Code:

 CLEDTask (CActLED *pActLED):CTask((uint8_t)1, (uint32_t)65535) { };

Statistics: Posted by WilliamJenkinson — Thu May 08, 2025 9:00 pm — Replies 0 — Views 35



Viewing all articles
Browse latest Browse all 6977

Trending Articles