根据以下程序讲解,argv[1] 和argv[2]的用法
#include <string.h>#define M 201
int main(int argc,char *argv[])
{
FILE *fp;
char str[M];
if ( ( fp=fopen(argv[2],"r") ) == NULL )
{
printf("Can't open %s",argv[2]);
exit(1);
}
while ( fgets(str,M,fp) != NULL )
if ( strstr(str, argv[1]) != NULL)
printf(str);
return 0;
}