logo

utils

~/.local/bin tools and git-hooks
commit: c9cbad15b34d5e60588d97d5c0e19918a67943ee
parent: 5c7bef349d7ec874ee337858fbf3c7ea2d91588e
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat, 18 Nov 2017 22:01:18 +0100

src/argc.c: Output separated args using *argv[]

Diffstat:

Msrc/argc.c10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/argc.c b/src/argc.c @@ -1,6 +1,14 @@ // Copyright CC-BY-SA-4.0 2017- Haelwenn (lanodan) Monnier <contact@hacktivis.me> +// printf() #include <stdio.h> + int main(int argc, char *argv[]) { - printf("%s: %i\n", argv[0], argc); + printf("argc: %i\n", argc); + + for(int i = 0; i<argc; i++) { + printf("argv[%d]: \"%s\"\n", i, argv[i]); + } + + return 0; }