掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
ファイルの中で改行するには? (ID:50208)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
MS-DOS/Windowsでの改行コードは,CrLfです。 fopenやfstreamを使って,テキストファイルとして開いた場合, ライブラリが\nとCrLfを変換してくれます。 #Windows APIの場合はCrLfを使う。 でもって,バイナリファイルの場合,通常CrLfは\r\nで扱います。 ちなみに,Unixでの改行コードはLf(Nl), MacintoshではCrです。 どちらも,C/C++のライブラリでは\nで扱います。 そんでもって,Cの仕様では, \n (New-Line) 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. となっています。 これに似せて書くなら,Lf (Line-Feed)は, Lf (Line-Feed) Moves the active position to the current position of the next line. ですかね。
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.