diff options
| author | 2025-11-19 17:24:17 +0100 | |
|---|---|---|
| committer | 2025-11-19 17:24:17 +0100 | |
| commit | 9d043755a73c170b56d364a0a671f18700a2aa19 (patch) | |
| tree | c2b596ed12df0d07ad1835488f6f91801fe0f979 /test/09-varargs.c | |
| parent | 34ff9d31d2ead5bdc2a22518c4496b8070fd679b (diff) | |
rename test/varargs
Diffstat (limited to 'test/09-varargs.c')
| -rw-r--r-- | test/09-varargs.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/test/09-varargs.c b/test/09-varargs.c deleted file mode 100644 index c15b887..0000000 --- a/test/09-varargs.c +++ /dev/null @@ -1,23 +0,0 @@ -/* EXPECT: -1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 = 36 -*/ - - -#include <stdarg.h> -#include <stdio.h> - -int sum(int x, ...) { - va_list ap; - va_start(ap, x); - printf("%d", x); - for (int y; (y = va_arg(ap, int));) { - printf(" + %d",y); - x += y; - } - va_end(ap); - return x; -} - -int main() { - printf(" = %d\n", sum(1,2,3,4,5,6,7,8,0,0)); -} |