- ベストアンサー
c言語での\nや\tなどすべての記号に語源はあるのでしょうか?
- みんなの回答 (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%83%AA%E3%83%83%E3%82%B8%E3%83%AA%E3%82%BF%E3%83%BC%E3%83%B3 http://www.wdic.org/w/WDIC/%E3%83%A9%E3%82%A4%E3%83%B3%E3%83%95%E3%82%A3%E3%83%BC%E3%83%89 http://www.wdic.org/w/WDIC/%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0%E3%83%95%E3%82%A3%E3%83%BC%E3%83%89 http://www.wdic.org/w/TECH/%E3%82%A2%E3%83%A9%E3%83%BC%E3%83%88
その他の回答 (1)
- himajin100000
- ベストアンサー率54% (1660/3060)
多分ある。ただ明確に由来だと書いてあるようには読めないが。 http://forum.sourceboost.com/index.php?showtopic=2805&mode=linearplus とかいうので http://en.wikipedia.org/wiki/C_(programming_language) の 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なのか も保証できない
関連するQ&A
- C言語 n!のプログラミング
C言語で、入力されたnについてのn!を求めるプログラムを書きました。 #include<stdio.h> int main() { int total=1,i,n; scanf("%d",&n); for(i=1;i<=n;i++){ total*=i; } printf("%d",total); } しかし、このままだとn=13くらいからオーバーフローしてしまって、n=100やn=10000といった大きな数の場合のn!が求められませんよね? 万進法という方法を使って、10000未満の数を配列の要素に割り当てる(説明が正しいかわかりませんが…)と、うまくいくと聞きました。 万進法とはどのようなものでしょうか?やり方を教えてください。 また、C言語での、このプログラムの一例もできれば教えてください。 ですが、今一番知りたいのはどういう手順でプログラムを書けばいいのかということですので、そちらの方を詳しく教えてください。
- ベストアンサー
- C・C++・C#
- 構文中の『\n』、『\n\t』について
構文中の『\n』、『\n\t』について 下記のC言語構文中の『\n』、『\n\t』の部分がどうしてもわかりません。 #define SLEEP asm volatile("sleep\n"::) または #define SLEEP asm volatile("sleep\n\t"::) ご教授下さい。 よろしくお願い致します。
- ベストアンサー
- C・C++・C#
- 「言語同断」の語源
「言語同断」は,”今更云うまでもない・・無礼な態度”とかいった意味に使いますが,どういう語源があるのでしょうか? 単語と熟語のつながりが全くないような気がするのでお尋ねします。 なお,こういう(四字熟語と語源の関連を解説する)サイトをご紹介いただけると有難いです。
- ベストアンサー
- 日本語・現代文・国語
- 数学記号の語源が気になっています。
数学の集合でよく用いられる記号 『∪』 『∩』 ってゆーのは、なんでこの形になったんですか?? 何かの文字や形からもじってあるとかなんですか? よくどっちがどっちだったか間違えてしまうんで、語源や意味から頭に入れると忘れないかな...と思ったんで、誰か教えてください!m(__)m
- 締切済み
- 数学・算数
- C言語について教えて下さい。
C言語について教えて下さい。 C言語の知識はないが、課題なので困ってます。 助けてください!!! 変更前 N00001 AAAA; N00002 M10; N00003 M11; N00004 BBBBB; N00005 YYYY; N00006 M12; N00007 M13; N00008 CCCCCC; N00009 YYYY; N00010 M14; N00011 M15; N00012 DDDDDDD; N00013 YYYY; N00014 EEEEEEEE; 変更後 N00001 AAAA; N00002 BBBBB; N00003 M10; N00004 M11; N00005 YYYY; N00006 CCCCCC; N00007 M12; N00008 M13; N00009 YYYY; N00010 DDDDDDD; N00011 M14; N00012 M15; N00013 YYYY; N00014 EEEEEEE
- 締切済み
- C・C++・C#
お礼
お二方ありがとうございます 参考にさせていただきます