ホーム » gcc » DS115j std::tostringstream

2017年6月
 123
45678910
11121314151617
18192021222324
252627282930  

カテゴリー

アーカイブ

ブログ統計情報

  • 77,426 アクセス



DS115j std::tostringstream

DS115j で,次の様なコードの str が “123” にならない(”0″ になる).


 {
   double checkValue = 123 ;
   tstring str ;
   std::tostringstream strBuf ;
   {
     strBuf << checkValue ;
     str = strBuf.str() ;
     }
   // …
   }


sprintf を利用することで対応.
 {
   std::string str ;
   tstring fmt = _T(“%.”) + ::To_tstring(p) + _T(“f”) ;
   str.resize(512,0) ;
   sprintf(&str[0],fmt.c_str(),v) ;
   // …
   }

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

コメントする

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

%d人のブロガーが「いいね」をつけました。