#Passing varags to another function

11 messages · Page 1 of 1 (latest)

valid raptor
#

How do i pass varargs to another function? Tried following examples from stackoverflow but code doesnt even enter first function

inner gorgeBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

valid raptor
#

my code is

#
void SCI::sendMultiSrc(const uint16_t packetType, const int sourcesCount, ...) {
    LOG_INF("SENDING2!");
    va_list argsList;
    if (bluetooth.connection) {
        va_start(argsList, sourcesCount);
        LOG_INF("HAVE CONN2!");
        bluetooth.sendMultiPacket(bluetooth.connection, packetType, sourcesCount, argsList);
        va_end(argsList);

        return;
    }```
rich shale
valid raptor
#

i tried this but i get some fatal error

#

ie i did change bluetooth.sendMultiPacket to use va_list instead

#

but im not exactly sure how to retrieve those arguments

#

allright, figured it out, need to use va_arg inside

#

!resolved

#

!solved