Drkcore

12 01 2010 Python cpp Tweet

c++のキャストとか

openbabelがC++で書かれているので、今年はC++を覚えようと。

int a = (int)('0'); // 48

これはpythonでいうord

>>> ord("0")
48

で、最初よく分からなかったのでこれ。

(char)(5 + '0'); // 5

結局

int a = 5 + '0'; // 53

となっているからint + charみたいなのもよろしくやっといてくれるっちゅう理解でいいのかな。

とりあえずクックブックでも買うべきか。

ProductName C++実践プログラミング
スティーブ オウアルライン
オライリージャパン / ¥ 6,090 ()
在庫あり。

ProductName C++クックブック
D. Ryan Stephens,Christopher Diggins,Jonathan Turkanis,Jeff Cogswell
オライリー・ジャパン / ¥ 4,515 ()
在庫あり。

About

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

Tag

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

Ad

© kzfm 2003-2021