Displaying ./code/feb21/string2.c#include <stdio.h> #include <stdlib.h> #include <string.h> #define BUF 512 int main(int argc, char **argv){ char words[BUF]; if(argc < 2) strcpy(words, "Nothing here"); else strcpy(words, argv[1]); if(words[0] == '-') printf("there may be an argument here\n"); printf("argv[1]: %s\n", words); return 0; } |