This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(int argc, char *argv[]) | |
{ | |
// create a program that outputs | |
// the name of the program, | |
// the first argument given and | |
// the last argument given. | |
printf("You are running the program \"%s\"\n", argv[0]); | |
printf("%i arguments have been passed\n", argc); | |
printf("the first argument is \"%s\"\n", argv[1]); | |
printf("the last argument is \"%s\"\n", argv[argc-1]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment