Drkcore

27 04 2008 cpp Tweet

C++でint型をstring型にするのは

sstreamとかsprintfを使えばよいらしい。

// char aaa[20];
// sprintf(aaa,"%d:%d:%d",h,m,mrim) ;
// string ret = aaa;

stringstream aaa;
aaa << h << ":" << m << ":" << mrim;
string ret = aaa.str();

stringstream使うほうが好きかも。

ProductName ロベールのC++入門講座
ロベール
毎日コミュニケーションズ / 3990円 ( 2007-11-15 )


About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021