我的頭文件如下:字符串在C頭文件
#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;
一行修復它,但我已經被告知這是在頭文件中的不好的做法。
謝謝,修復它。 – Maxpm 2010-11-11 21:26:22