在c中调用函数(对arduino编程)时,该函数会在执行原始函数中的下一行代码之前完成吗?

请参阅以下示例中的注释:

void loop()
{
    duration = random(750, 1500);
    advertise("111", duration); // <-- will this function fully complete
    int delayDuration = random (300,500); // <--before executing this line of code?
    delay(delayDuration);
}

最佳答案

是。 thread中的代码执行顺序发生。被调用函数应return,并且应从被调用函数中的下一条语句继续执行。

关于c - 在执行c中的下一行代码之前,被调用函数是否已完成,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/29901922/

10-11 21:45
查看更多