Deprecated: Array and string offset access syntax with curly braces is deprecated in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/init.php on line 542
ja:root:tstring [GiriWiki]

ユーザ用ツール

サイト用ツール


ja:root:tstring

差分

この文書の現在のバージョンと選択したバージョンの差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ja:root:tstring [2014/04/26 03:47]
kota [LOOPで生成]
ja:root:tstring [2018/02/06 07:21] (現在)
kota [基本的な使い方]
ライン 9: ライン 9:
   * やり方色々   * やり方色々
 <code c_mac> <code c_mac>
-TString str("​hoge"​); ​ //​ありがち+TString str("​hoge"​);​
  
-TString str = "​hoge"; ​//​こちらもありがち+TString str = "​hoge";​
  
 TString str;          //​まず宣言してから TString str;          //​まず宣言してから
ライン 36: ライン 36:
 cout << str.Data() << endl; cout << str.Data() << endl;
 </​code>​ </​code>​
-  * 上の2つの出力は同じ(hoge)。Data関数の意味?よくわからん+  * 上の2つの出力は同じ(hoge)。TString::Data()は Char_t* を返している。
  
  
ライン 49: ライン 49:
                                        // hoge1.root と出力される                                        // hoge1.root と出力される
  
 + cout << Form("​hoge%02d.root",​1) << ","​ << Form("​hoge%03d.root",​1) << endl;
 +                                       //​フォーマット指定子のリーディングゼロの機能(0詰め)を使うと、
 +                                       //​hoge01.root , hoge001.root と出力される
 </​code>​ </​code>​
  
ライン 56: ライン 59:
       * %f  : float        * %f  : float 
       * %lf : double       * %lf : double
 +      * %c  : char  (1文字)
 +      * %s  : char* , TString (文字列)
 +      * %lld: Long64_t
  
 ---- ----
ja/root/tstring.1398484064.txt.gz · 最終更新: 2014/04/26 03:47 by kota