博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
课上程序的补充
阅读量:6862 次
发布时间:2019-06-26

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

#include"stdio.h"#include"string.h"int main(){    void funstr(char str[]);    char str[]="hello world";    str[0]='H';    str[6]='W';    printf("%s\n",str);    funstr(str);    }  void funstr(char str[]) {     int i;     i=0;     while(str[i]!='\0')     {         printf("%c\n",str[i++]);         }     }

运行结果:

Hello World

H
e
l
l
o

W

o
r
l
d

--------------------------------

Process exited after 0.397 seconds with return value 0
请按任意键继续. . .

 

总结:在课堂上没有对i 赋予初值,大小写可以转换,但是一直显示程序出错,下次要注意定义一个整型,弄清楚函数的形式和要求。

转载于:https://www.cnblogs.com/cccyb/p/6649204.html

你可能感兴趣的文章
地对地导弹地对地导弹地对地导弹
查看>>
让div 充满整个body
查看>>
程序员保持快乐活跃的6个好习惯(转)
查看>>
找工作的一些感悟——前端小菜的成长
查看>>
jSON Call can throw but it is not marked with try
查看>>
Javascript图片裁切
查看>>
Android -- Serializable和Parcelable需要注意的
查看>>
Apache -- phpmyadmin导入文件过大
查看>>
我的友情链接
查看>>
一分钟看懂Docker的网络模式和跨主机通信
查看>>
数据中悲观锁和乐观锁的理解
查看>>
能想到登录失败是这原因么
查看>>
Shiro 权限管理filterChainDefinitions过滤器配置
查看>>
我的友情链接
查看>>
Python 文件I/Oday14
查看>>
回忆Spring IOC 几个注解&简单示例
查看>>
及时更新网卡驱动可使无线网络更稳定
查看>>
在if中赋值,但在if外却提示“使用了未赋值的局部变量”
查看>>
MapReduce源码之OutputFormat
查看>>
资质申报 - 系统集成企业资质等级评定条件实施细则
查看>>