Created
June 2, 2017 12:41
-
-
Save camilajenny/bf8bce445f3b33117d473978fb53d6b8 to your computer and use it in GitHub Desktop.
send multiple characters using `COM_send`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdarg.h> | |
void COM_send_m(int n, ...) { | |
va_list send; | |
va_start(send, n); | |
while(n--) | |
COM_send(va_arg(send, char*)); | |
va_end(send); | |
} | |
int main() { | |
char Z1 = 1; | |
COM_send_m(4, ':', Z1, !Z1, '#'); | |
return 0; | |
} |
Tak, ale wtedy wykona się o 1 raz za mało 😄 (przy --n
)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
--n jest szybsze ;p