2012年2月20日 星期一
Compile Commands
Microsoft Visual C++ 2008
cl ex8-13.cpp –EHsc
Note: executable name is ex8-13.exe
GNU gxx version 3.10b (for DOS)
g++ ex8-13.cpp -o grep.exe –Wall
****** Sample Program Execution ******
C:\deanza\examples>grep system *.cpp
ex8-13.cpp[25] system_command_status;
ex8-13.cpp[61] // system() allows you to issue operating system commands
ex8-13.cpp[62] system_command_status = system(command);
ex8-13.cpp[64] // check the status of the system command
ex8-13.cpp[65] if (system_command_status == -1) {
ex8-13.cpp[66] cerr << "Error with system command: " << command << endl;
ex8-13.cpp[128] // Issue system erase command
ex8-13.cpp[129] system_command_status = system(command);
ex8-13.cpp[131] // status system command
ex8-13.cpp[132] if (system_command_status == -1) {
ex8-13.cpp[133] cerr << "Error with system command: " << command << endl;
all2htm.cpp[65] status = system(command);
Found 12 occurrence(s) in 96 file(s)
C:\djgpp\include> \deanza\examples\grep access *.h
dpmi.h[148] int __dpmi_get_descriptor_access_rights(int _selector); /* LAR instruction */
dpmi.h[149] int __dpmi_set_descriptor_access_rights(int _selector, int _rights); /* DPMI 0.9 AX=0009 */
io.h[37] #define sopen(path, access, shflag, mode) \
io.h[38] open((path), (access)|(shflag), (mode))
unistd.h[76] int access(const char *_path, int _amode);
unistd.h[125] /* additional access() checks */
Found 6 occurrence(s) in 60 file(s)
Note: this next sample run has quoted arguments for the command. The first argument allows you to search for more than one word in the file. The second argument is quoted, because the GNU executable version wanted wildcard arguments quoted.
C:\deanza\examples>grep "virtual function" "*.*"
EX7-15.CPP[33] virtual double area(void) const = 0; // pure vir
tual function
EX7-15.CPP[34] virtual double girth(void) const = 0; // pure virtual function
Found 2 occurrence(s) in 124 file(s)
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言