diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-01-03 15:16:17 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-01-03 15:16:17 -0800 |
commit | 8478d6aee54d6c52de16d8c58309534afbf5bf9e (patch) | |
tree | bec73fd8e0cd6888d2dfb6b9e6a1423cc2432f61 /tests/hello_world_exit.c | |
parent | 1a007b1631509b9d72499a8f4402294017ee04dc (diff) | |
parent | a8e26049c1a72fa6b19dac45fa2b44616f94241a (diff) |
Merge branch 'incoming'
Diffstat (limited to 'tests/hello_world_exit.c')
-rw-r--r-- | tests/hello_world_exit.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/hello_world_exit.c b/tests/hello_world_exit.c new file mode 100644 index 00000000..8932caf2 --- /dev/null +++ b/tests/hello_world_exit.c @@ -0,0 +1,15 @@ +#include<stdio.h> +#include<stdlib.h> + +int main(int argc, char **argv) { + printf("argc: %d\n", argc); + for(int i = 0; i < argc; ++i) { + printf("argv[%d]: %s\n", i, argv[i]); + } + if (argc <= 1) + exit(1); + printf("hello, world!\n"); + fprintf(stderr, "hello, error stream!\n"); + exit(100); +} + |