std::string最小限のコードでの最初の文字を取得する必要があります。
STL から 1 行のコードで最初の char を取得できれば素晴らしいことstd::map<std::string, std::string> map_of_stringsです。次のコードは正しいですか:
map_of_strings["type"][0]
編集 現在、私はこのコードを使用しようとしています。このコードは正しいですか?
if ( !map_of_strings["type"].empty() )
ptr->set_type_nomutex( map_of_strings["type"][0] );
set_type関数のプロトタイプは次のとおりです。
void set_type_nomutex(const char type);