Instantly share code, notes, and snippets.

@dstein64 /echo.c
Last active Oct 24, 2017

Embed
What would you like to do?
/*** echo.c ***/
// Description
// echo - print arguments to stdout
// Synopsis
// echo [STRING]...
// Build
// $ gcc -o echo echo.c
#include <stdio.h>
int main(int argc, char* argv[]) {
for (int i = 1; i < argc; ++i) {
if (i > 1) printf(" ");
printf("%s", argv[i]);
}
printf("\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment