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:cpp:wanttodo1 [GiriWiki]

ユーザ用ツール

サイト用ツール


ja:cpp:wanttodo1

以前のリビジョンの文書です



Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/parser/handler.php on line 1458

Warning: Declaration of syntax_plugin_note::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/lib/plugins/note/syntax.php on line 79

Warning: Declaration of syntax_plugin_note::render($mode, &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/lib/plugins/note/syntax.php on line 101

Warning: preg_match(): Compilation failed: invalid range in character class at offset 3120 in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/parser/lexer.php on line 118
A PCRE internal error occured. This might be caused by a faulty plugin

====== std::cout の出力に色をつけたい ====== ---- c++の機能で実現するのではなく、ターミナル(コンソール)にエスケープシーケンスを送りつけて実現する。 エスケープ文字は"\033"(8進数表示)または"\x1b"(16進数表示)で表されるものである。 <code cpp> std::cout << "\033[31m aho \033[m" << std::endl; </code> のようにすると aho が赤文字になる。 最後の"\033[m" は指定の解除。 実はコンソールのSGR(Select Graphic Rendition)コマンドというものらしい。 文法的には "ESC[○○m"というような形でグラフィック系の指定を行う。\\ ○○の部分が、例えば30番台は文字色が 30:black, 31:red, 32:green, 33:yellow, 34:blue, 35:magenta, 36:cyan, 37:white となる。\\ 40番台は背景色が同様に変わる。 その他、 * "\033[0m" : 指定リセット (= "\033[m") * "\033[1m" : 太字 * "\033[2m" : 文字を薄く表示 * "\033[3m" : イタリック * "\033[4m" : 下線 * "\033[5m" : 点滅 * "\033[6m" : 点滅(高速) * "\033[7m" : 文字色-背景 入れ替え * "\033[8m" : 表示を隠す * "\033[9m" : 取り消し などがある。 

ja/cpp/wanttodo1.1508243552.txt.gz · 最終更新: 2017/10/17 12:32 by kota