私は自分のコードでstdを含む多くの名前空間を使用していますので、コード内に文字列変数を宣言したいときは、正確なstd :: stringか文字列を入れることができます:std :: stringと文字列
#include <string.h>
using namespace std;
using namespace boost;
using namespace xerces;
int main()
{
/*! should I declare my str like this */
std::string str;
/*! or I can declare it like this */
string str1;
cout << str << str1 <<endl;
return 0;
}
これは 'using'が対象です: –
' #include 'はあなたに' std :: string'宣言をもたらしません。 –
[なぜ 'namespace std;を使用していますか? C++での悪い習慣と考えていますか?](http://stackoverflow.com/a/1453605/140719) – sbi