プロが教える店舗&オフィスのセキュリティ対策術

c言語での\nや\tなどすべての記号に語源はあるのでしょうか?

A 回答 (2件)

★まとめ


・ネットでは、なかなか略語(語源)まで見つかりませんね。
 1つは見つかったが \a をアラームになっている。アラートの方です。
 \a 07h BEL アラート(Alert)
 \b 08h BS  バック スペース(Back Space)
 \f 0Ch FF  フォーム フィード (Form Feed)
 \n 0Ah LF  行送り、ライン フィード (Line Feed)または(New Line)
 \r 0Dh CR  復帰、キャリッジ リターン (Carriage Return)または(Return)
 \t 09h HT  水平タブ(Horizontal Tab)
 \v 0Bh VT  垂直タブ(Vertical Tab)
 http://www.tamasoft.co.jp/lc/hlp/F017.html→『エスケープ シーケンス』

参考資料:
http://www.wdic.org/w/WDIC/%E3%82%AD%E3%83%A3%E3 …
http://www.wdic.org/w/WDIC/%E3%83%A9%E3%82%A4%E3 …
http://www.wdic.org/w/WDIC/%E3%83%95%E3%82%A9%E3 …
http://www.wdic.org/w/TECH/%E3%82%A2%E3%83%A9%E3 …
    • good
    • 0
この回答へのお礼

お二方ありがとうございます
参考にさせていただきます

お礼日時:2008/01/19 14:11

多分ある。

ただ明確に由来だと書いてあるようには読めないが。

http://forum.sourceboost.com/index.php?showtopic …
とかいうので

http://en.wikipedia.org/wiki/C_(programming_lang …

External links
にあるPDFの仕様書内を
\nで検索かけた

5.2.2 Character display semantics

Alphabetic escape sequences representing nongraphic characters in the execution
character set are intended to produce actions on display devices as follows:

\a (alert)Produces an audible or visible alert without changing the active position.

\b (backspace)Moves the active position to the previous position on the current line. If the active position is at the initial position of a line, the behavior of the display device is unspecified.
\f (form feed)Moves the active position to the initial position at the start of the next
logical page.
\n (newline)Moves the active position to the initial position of the next line.
\r (carriage return)Moves the active position to the initial position of the current line.
\t (horizontal tab)Moves the active position to the next horizontal tabulation position
on the current line. If the active position is at or past the last defined horizontal
tabulation position, the behavior of the display device is unspecified.
\v (vertical tab)Movesthe active position to the initial position of the next vertical
tabulation position. If the active position is at or past the last defined vertical

ただ,
\rが
carriage Returnであって
caRriage returnや
carRiage returnや
でないことが示せない
(ないと思うけど, WindowsだってCutとCopyのアクセスキーが
Cu【t】と【C】opyみたいな中途半端なときあるので)

同様に
Form feedなのか
form Feedなのか
も保証できない
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!