Skip to content

Instantly share code, notes, and snippets.

@dstein64
Last active October 24, 2017 16:58
Show Gist options
  • Save dstein64/0eff27ecc06fa1349e390b4459ffb841 to your computer and use it in GitHub Desktop.
Save dstein64/0eff27ecc06fa1349e390b4459ffb841 to your computer and use it in GitHub Desktop.
/*** 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