【发布时间】:2010-11-11 21:21:47
【问题描述】:
我的头文件如下:
#include <iostream>
#include <string>
#include <windows.h>
#include <math.h>
//using namespace std;
std::string StringMultiply(string Str, int Mult)
{
std::string Return;
for (int Index = 0; Index <= Mult; Index++)
{
Return += Str;
}
return Return;
}
编译它会产生大量错误,其中大部分与缺少 string 数据类型有关。取消注释 using namespace std; 行可以修复它,但有人告诉我这是头文件中的不好做法。
【问题讨论】:
标签: c++ string namespaces header std