首页 > 编程语言 > 详细

C语言 puts

时间:2020-02-27 19:10:33      阅读:88      评论:0      收藏:0      [点我收藏+]

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

 

C语言 puts

原文:https://www.cnblogs.com/xiangsikai/p/12373684.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!