为什么我的VC++6.0提示没有print.hpp头文件???紧急求救!!!拜托各位了 3Q

2025-05-09 01:47:43
推荐回答(1个)
回答(1):

STL和C++标准库里都没有print.hpp这个头文件。 如果你要找的是这个: #include /* PRINT_ELEMENTS() * - prints optional C-string optcstr followed by * - all elements of the collection coll * - separated by spaces */ template inline void PRINT_ELEMENTS (const T& coll, const char* optcstr="") { typename T::const_iterator pos; std::cout << optcstr; for (pos=coll.begin(); pos!=coll.end(); ++pos) { std::cout << *pos << ' '; } std::cout << std::endl; } 另存为print.hpp,放到合适的位置。