2009-05-10から1日間の記事一覧

2進数 2進定数をテンプレートを使用して記述する方法

C++

ttp://cppemb.blog17.fc2.com/blog-entry-42.html 転載 int x = B(0101); /* 0x05 */ template <int Bit> struct bit; template <> struct bit<0> { static const int value = 0; }; template <> struct bit<1> { static const int value = 1; }; template <unsigned long N> struct bi</unsigned></int>…

入れ子のループから指定のループを抜ける/コンティニュー

label1: while(true) { System.out.println("aaa"); break label1; } System.out.println("bbb"); 入れ子のループから指定のループを抜ける/コンティニュー。 break; continue;

変数名に$が使える

int $ = 1; String a$ = "abc"; System.out.println($ + a$);//1abc