博客
关于我
输入输出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/

    你可能感兴趣的文章
    No resource identifier found for attribute 'srcCompat' in package的解决办法
    查看>>
    no session found for current thread
    查看>>
    No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
    查看>>
    NO.23 ZenTaoPHP目录结构
    查看>>
    no1
    查看>>
    NO32 网络层次及OSI7层模型--TCP三次握手四次断开--子网划分
    查看>>
    NOAA(美国海洋和大气管理局)气象数据获取与POI点数据获取
    查看>>
    NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationBeanFactoryMetadata
    查看>>
    node exporter完整版
    查看>>
    Node JS: < 一> 初识Node JS
    查看>>
    Node JS: < 二> Node JS例子解析
    查看>>
    Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime(72)
    查看>>
    Node 裁切图片的方法
    查看>>
    Node+Express连接mysql实现增删改查
    查看>>
    node, nvm, npm,pnpm,以前简单的前端环境为什么越来越复杂
    查看>>
    Node-RED中Button按钮组件和TextInput文字输入组件的使用
    查看>>
    Node-RED中Switch开关和Dropdown选择组件的使用
    查看>>
    Node-RED中使用html节点爬取HTML网页资料之爬取Node-RED的最新版本
    查看>>
    Node-RED中使用JSON数据建立web网站
    查看>>
    Node-RED中使用json节点解析JSON数据
    查看>>