タグ

関連タグで絞り込む (2)

タグの絞り込みを解除

c++に関するcomuttのブックマーク (2)

  • 250bpm

    ← Why should I have written ZeroMQ in C, not C++ (part I) Just to be clear from the very beginning: This is not going to be a Torvalds-ish rant against C++ from the point of view of die-hard C programmer. I've been using C++ whole my professional career and it's still my language of choice when doing most projects. Naturally, when I started ZeroMQ project back in 2007, I've opted for C++. The main

  • UTF-8 + 文字数カウント - utahta blog

    C++UTF-8 の文字数を数えるコードを試しに書いてみたメモ。 バイト数ではなく、文字数。 #include #include int strlen_utf8( const char *buff ) { if( buff == NULL ) return 0; int count = 0; int pos = 0; int max_bytes = strlen( buff ); // BOM 読み飛ばし if( max_bytes >= 3 ) { if( static_cast( buff[0] ) == 0xEF && static_cast( buff[1] ) == 0xBB && static_cast( buff[2] ) == 0xBF ) { pos += 3; } } while( pos < max_bytes ) { ++count; // 文字数カウント i

    UTF-8 + 文字数カウント - utahta blog
  • 1