📄 pu
字号:
@c ----------------------------------------------------------------------
@node putc, stdio
@heading @code{putc}
@subheading Syntax
@example
#include <stdio.h>
int putc(int c, FILE *file);
@end example
@subheading Description
This function writes one character to the given @var{file}.
@subheading Return Value
The character written.
@subheading Example
@example
while ((c=getc(stdin)) != EOF)
putc(c, stdout);
@end example
@c ----------------------------------------------------------------------
@node putchar, stdio
@heading @code{putchar}
@subheading Syntax
@example
#include <stdio.h>
int putchar(int c);
@end example
@subheading Description
This is the same as @code{fputc(c, stdout)}. @xref{fputc}
@subheading Return Value
The character written.
@subheading Example
@example
while ((c = getchar()) != EOF)
putchar(c);
@end example
@c ----------------------------------------------------------------------
@node putenv, environment
@heading @code{putenv}
@subheading Syntax
@example
#include <stdlib.h>
int putenv(const char *env);
@end example
@subheading Description
This function adds an entry to the program's environment. The string
passed must be of the form @code{NAME}=@code{VALUE}. Any existing value
for the environment variable is gone.
Note that the string passed to @code{putenv} becomes part of the
environment itself, so you must not free it.
@subheading Return Value
Zero on success, nonzero on failure.
@subheading Example
@example
putenv("SHELL=ksh.exe");
@end example
@c ----------------------------------------------------------------------
@node puts, stdio
@heading @code{puts}
@subheading Syntax
@example
#include <stdio.h>
int puts(const char *string);
@end example
@subheading Description
This function writes @var{string} to @code{stdout}, and then writes a
newline character.
@subheading Return Value
Nonnegative for success, or @code{EOF} on error.
@subheading Example
@example
puts("Hello, there");
@end example
@c ----------------------------------------------------------------------
@node putw, stdio
@heading @code{putw}
@subheading Syntax
@example
#include <stdio.h>
int putw(int x, FILE *file);
@end example
@subheading Description
Writes a single binary word in native format to @var{file}.
@subheading Return Value
The value written, or @code{EOF} for end-of-file or error. Since
@code{EOF} is a valid integer, you should use @code{feof} or
@code{ferror} to detect this situation.
@subheading Example
@example
putw(12, stdout);
@end example
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -