|
发表于 2002-11-19 12:52:31
|
显示全部楼层
kj501:
这是在命令行接受参数用的。argc表示参数个数,**argv是指向字符串数组的指针。如你用ls -l di*.c命令时,ls接受的argc为3(注意包括ls命令本身在内),argv[0]="ls"也就是命令自身,argv[1]=“-l",argv[2]=”di*.c",这样不管给命令有多少个参数,都能在程序中进行处理。在谭浩强编写的《C程序设计》里有详细论述,你可以找来看看。 Good explanation. However this is a C++ program, I would never recommend a C programming book for a C++ learner.
``std::'' is specifying the namespace of the following objects. As a beginner you needn't know much about namespace (as you needn't know much about standard library), just use it. If you find it too tedious (maybe you need to write a lot of cout), just claim that you would like to use std namespace for the whole file, like:
- #include <iostream>
- using namespace std;
- int main()
- {
- cout << "Hello world!" << endl;
- }
复制代码 Hope this helps. |
|