Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdarg.h>
- #include <stdio.h>
- #define program(arguments) void main(void) {arguments;}
- #define calculate(...) (calculate__(sizeof((int[]){__VA_ARGS__})/sizeof(int), __VA_ARGS__))
- int calculate__(int number, ...) {
- int sum = 0;
- va_list arguments;
- va_start(arguments, number);
- for(int i = 0; i < number; i++) {
- sum += va_arg(arguments, int);
- }
- va_end(arguments);
- return printf("%d", sum);
- }
- #define __calculate calculate__
- #define _calculate calculate__
- typedef int * pointer_int;
- typedef void * pointer_void;
- typedef char * pointer_char;
- program(
- int i = 0;
- printf("%d", i);
- printf("%d", calculate(1 * 2 - 3 + 4 / 5))
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement