第一篇博客:Hello world
第一篇博客:Hello World
#include <iostream>
int main() {
std::cout<<"Hello world!"<<std::endl;
return 0;
}
Know what you want to say.
Practice. Imitate good writing.
Prefer standard-library facilities to locally developed code.
Don't use malloc(). The new operator does the same job better, and instead of realloc(), try a vector.
Don't introduce a name until you have a suitable value for it.
Use constructor/destructor pairs to simplify resource management.
Use containers and algorithms rather than built-in arrays and ad hoc code.
Recommand the standard-library vector as the default type for sequences of elements: you need a reason to choose another.
Choose names to reflect the meaning of an entity rather than its implementation.