博客
关于我
输入输出I/O(二)
阅读量:605 次
发布时间:2019-03-12

本文共 584 字,大约阅读时间需要 1 分钟。

今天和大家继续分享关于C语言函数库的知识,特别是常用的字符串输出函数。

  • printf函数
  • printf("格式字符串", 输出项1, 输出项2, ...) 这是最常用的格式化输出函数。格式字符串中使用%符号控制输出类型。例如:

    #include 
    int main() { int i = 10; printf("i=%d\n", i); return 0;}
    1. puts函数
    2. puts()函数用于输出字符串。直接将字符串传递给函数即可。例如:

      #include 
      int main() { char a[] = "I love you!"; puts(a); return 0;}
      1. putchar函数
      2. putchar()函数用于输出单个字符,适合逐个处理大字符串中的字符。例如:

        #include 
        int main() { char a[] = "I love you!"; int i = 0; for (; i < 12; i++) { putchar(a[i]); } return 0;}

        这些函数是C语言中处理字符串输出的常用工具,熟练掌握它们能显著提高开发效率。如果需要更深入的学习,欢迎继续关注我们。

    转载地址:http://xjpxz.baihongyu.com/

    你可能感兴趣的文章
    OA系统选型:选择好的工作流引擎
    查看>>
    OA让企业业务流程管理科学有“据”
    查看>>
    OA项目之会议通知(查询&是否参会&反馈详情)
    查看>>
    OA项目之我的会议(会议排座&送审)
    查看>>
    OA项目之我的会议(查询)
    查看>>
    OA项目之我的审批(会议查询&会议签字)
    查看>>
    OA项目之项目简介&会议发布
    查看>>
    Object c将一个double值转换为时间格式
    查看>>
    object detection之Win10配置
    查看>>
    object detection训练自己数据
    查看>>
    object detection错误Message type "object_detection.protos.SsdFeatureExtractor" has no field named "bat
    查看>>
    object detection错误之Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
    查看>>
    object detection错误之no module named nets
    查看>>
    Object of type 'ndarray' is not JSON serializable
    查看>>
    Object Oriented Programming in JavaScript
    查看>>
    object references an unsaved transient instance - save the transient instance before flushing
    查看>>
    Object.assign用法
    查看>>
    Object.create
    查看>>
    Object.keys()的详解和用法
    查看>>
    objectForKey与valueForKey在NSDictionary中的差异
    查看>>