C语言 puts

丶灬走出姿态 提交于 2020-02-27 19:11:03

C语言 puts

#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 使用案例

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!