Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string.h>
- #include <stdio.h>
- #include <unistd.h>
- void greet (char *arg)
- {
- char name[32];
- strcpy(name, arg);
- printf("Hi %s\n", name);
- }
- int main (int argc, char *argv[])
- {
- sleep(1);
- if(argc!=2)
- {
- printf("Example: %s NAME\n", argv[0]);
- }
- else
- {
- greet(argv[1]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement