.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" Modified Sat Jul 24 18:42:59 1993 by Rik Faith (faith@cs.unc.edu) .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka .\" all rights reserved. .\" Translated Wed Dec 24 12:33:40 JST 1997 .\" by HIROFUMI Nishizuka .\" Updated Fri Nov 2 JST 2001 by Kentaro Shirakata .\" .TH PUTS 3 2014\-01\-11 GNU "Linux Programmer's Manual" .SH 名前 fputc, fputs, putc, putchar, puts \- 文字と文字列の出力 .SH 書式 .nf \fB#include \fP .sp \fBint fputc(int \fP\fIc\fP\fB, FILE *\fP\fIstream\fP\fB);\fP \fBint fputs(const char *\fP\fIs\fP\fB, FILE *\fP\fIstream\fP\fB);\fP \fBint putc(int \fP\fIc\fP\fB, FILE *\fP\fIstream\fP\fB);\fP \fBint putchar(int \fP\fIc\fP\fB);\fP \fBint puts(const char *\fP\fIs\fP\fB);\fP .fi .SH 説明 \fBfputc\fP() は、キャラクター \fIc\fP を \fIunsigned char\fP にキャストし、 \fIstream\fP に書き込む。 .PP \fBfputs\fP() は、文字列 \fIs\fP を \fIstream\fP に書き込む。 文字列終端のヌルバイト (\(aq\e0\(aq) は出力しない。 .PP \fBputc\fP() は、 \fIstream\fP を一度以上評価するマクロとして実装されているかも知れないという点を除き、 \fBfputc\fP() と同じである。 .PP \fBputchar(\fP\fIc\fP\fB)\fP は、 \fBputc(\fP\fIc\fP\fB,\fP\fIstdout\fP\fB)\fP と同じである。 .PP \fBputs\fP() は、文字列 \fIs\fP と改行を \fIstdout\fP に書き込む。 .PP ここで説明された関数はお互いに混在して使用することができ、また、 \fIstdio\fP ライブラリに含まれる他の出力関数を同じ出力ストリームに対して 呼び出す事が出来る。 .PP これらの処理を停止せずに行いたいときは、 \fBunlocked_stdio\fP(3) を参照のこと。 .SH 返り値 \fBfputc\fP(), \fBputc\fP(), \fBputchar\fP() は \fIunsigned char\fP として書き込まれた文字を \fIint\fP にキャストして返す。 エラーが発生した場合は \fBEOF\fP を返す。 .PP \fBputs\fP() と \fBfputs\fP() は、成功すると負ではない数を、エラーが発生した場合は \fBEOF\fP を返す。 .SH 準拠 C89, C99. .SH バグ \fIstdio\fP ライブラリに含まれる出力関数と、同じ出力ストリームに結びつけられた ファイルディスクリプターに対する \fBwrite\fP(2) の低レベル呼び出しを混在して 使用することは賢明ではない。 その結果は定義されておらず、望む結果が得られない可能性が高い。 .SH 関連項目 \fBwrite\fP(2), \fBferror\fP(3), \fBfgets\fP(3), \fBfopen\fP(3), \fBfputwc\fP(3), \fBfputws\fP(3), \fBfseek\fP(3), \fBfwrite\fP(3), \fBputwchar\fP(3), \fBscanf\fP(3), \fBunlocked_stdio\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。