2007-07-28から1日間の記事一覧

関数へのポインターの出力(C++ 編)

fptostr.c を、C++ で書き直してみた。 これで、「CHAR_BIT が 4 の倍数の場合にしか対応していない」という制限は無くなった。 fptostr.cpp #include <bitset> #include <cstring> #include <limits> #include <string> #include <iostream> typedef int (*funcptr_t)(); std::string fptostr(funcptr_t</iostream></string></limits></cstring></bitset>…