0
に変換したいconst char*[2]
パラメータのVisual Studio 2008 C++アプリケーションがあります。これを行う簡単な方法はありますか?例えば`const char * [2]`から{string、string>に変換します。
:
typedef std::pair< std::string, std::string > Group;
const char* a[ 2 ] = { "buzz", "foo" };
Group z = a; // ???
// a->first.c_str() == "buzz"
// a->second.c_str() == "foo"
おかげで、あなたはおそらくしたい PaulH
'pair'は/任意の配列を持っていませんイテレータ/レンジコンストラクタこれはおそらく最良の答えです。 – aschepler