.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) .\" .\" 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. .\" Modified Sat Jul 24 18:42:59 1993 by Rik Faith (faith@cs.unc.edu) .\" .\" 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 1993-04-04 "GNU" "Linux Programmer's Manual" .SH 名前 fputc, fputs, putc, putchar, puts \- 文字と文字列の出力 .SH 書式 .nf .B #include .sp .BI "int fputc(int " c ", FILE *" stream ); .BI "int fputs(const char *" "s" ", FILE *" "stream" ); .BI "int putc(int " c ", FILE *" stream ); .BI "int putchar(int " c ); .BI "int puts(const char *" "s" ); .fi .SH 説明 .BR fputc () は、キャラクタ .I c を .I "unsigned char" にキャストし、 .I stream に書き込む。 .PP .BR fputs () は、文字列 .I s を .I stream に書き込む。 文字列に続く .B \(aq\e0\(aq は出力しない。 .PP .BR putc () は、 .I stream を一度以上評価するマクロとして実装されているかも知れないという点を除き、 .BR fputc () と同じである。 .PP .BI "putchar(" c ); は、 .BI "putc(" c , stdout ) と同じである。 .PP .BR puts () は、文字列 .I s と改行を .I stdout に書き込む。 .PP ここで説明された関数はお互いに混在して使用することができ、また、 .I stdio ライブラリに含まれる他の出力関数を同じ出力ストリームに対して 呼び出す事が出来る。 .PP これらの処理をロックせずに行いたいときは、 .BR unlocked_stdio (3) を参照のこと。 .SH 返り値 .BR fputc (), .BR putc (), .BR putchar () は .I unsigned char として書き込まれた文字を .I int にキャストして返す。 エラーが発生した場合は .B EOF を返す。 .PP .BR puts () と .BR fputs () は、成功すると負ではない数を、エラーが発生した場合は .B EOF を返す。 .SH 準拠 C89, C99. .SH バグ .I stdio ライブラリに含まれる出力関数と、同じ出力ストリームに結びつけられた ファイルディスクリプタに対する .BR write (2) の低レベル呼び出しを混在して 使用することは賢明ではない。 その結果は定義されておらず、望む結果が得られない可能性が高い。 .SH 関連項目 .BR write (2), .BR ferror (3), .BR fopen (3), .BR fputwc (3), .BR fputws (3), .BR fseek (3), .BR fwrite (3), .BR gets (3), .BR putwchar (3), .BR scanf (3), .BR unlocked_stdio (3)