#include <stdio.h>
int puts(const char *s);

功能:标准设备输出s字符串,在输出完成后自动输出一个'\n'。

参数:

  • s:字符串首地址

返回值:

  • 成功:非负数
  • 失败:-1

案例

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>

int main(void)
{
    // puts()
    // 自带换行,空格可以输出
    // 输出字符串自带换行,遇到\0停止
    // puts("");换行操作
    char ch3[] = "heelo world";
    puts(ch3);
    puts("heelo\0 world");

    return 0;
}
puts 使用案例

相关文章:

  • 2021-12-24
  • 2021-08-21
  • 2022-12-23
  • 2021-06-18
  • 2022-12-23
  • 2021-12-20
  • 2021-12-19
  • 2021-09-18
猜你喜欢
  • 2022-12-23
  • 2021-04-27
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2021-06-11
  • 2022-12-23
相关资源
相似解决方案