# Include <iostream>
# Include <fstream>
# Include <direct. h>
# Include <io. h>
# Include <string>
# Include "my_dll1.hpp"
Using namespace std;
Int countLine (char * filename );
Void countBrowseLine (char * pathName, char * filetype );
Int main (int argc, char * argv [])
{
If (* (argv + 1) = NULL | * (argv + 2) = NULL)
{
Return 0;
}
Char str [50];
Strcpy (str, * (argv + 1 ));
Char type [20];
Strcpy (type, * (argv + 2 ));
CountBrowseLine (str, type );
System ("pause ");
Return 0;
}
Void countbrowseline (char * pathname, char * filetype)
{
_ Chdir (pathname );
_ Finddata_t fdata;
Int ntotal = 0;
Int n = 0;
Long label = _ findfirst (filetype, & fdata );
Do
{
Cout <"the lines of the" <fdata. Name <"is ";
N = countline (fdata. Name );
Ntotal + = N;
Cout <n <Endl;
} While (_ findnext (Label, & fdata) = 0 );
Cout <"all the lines of the Browse about" <filetype <"is" <ntotal <Endl;
}
Int countline (char * filename)
{
Int ncount = 0;
Fstream fin (filename );
Char c [300];
If (! Fin)
{
Cout <"file read error" <endl;
Return 0;
}
While (! Fin. eof ())
{
Fin. getline (c, 300 );
++ NCount;
}
Fin. close ();
Return nCount;
}