练习5-3&&5-4&&5-5
2014-01-25 19:31
176 查看
练习5-3
练习5-4
练习5-5
#include <stdio.h> #include "chapter_5.h" void Strcat(char *s, char *t) {//5-3 while (*s != '\0' && *t !='\0') { ++s; } while (*t != '\0') { *(s++) = *t; ++t; } }
练习5-4
#include <stdio.h> #include "chapter_5.h" int Strend(char *s, char r) {//5-4 while (*s != '\0') ++s; if (*(--s) == r) return 1; else return 0; }
练习5-5
#include <stdio.h> #include <stdbool.h> #include "chapter_5.h" void Strncpy(char *s, char *t, int n) {//5-5 int count = 0; while (*t != '\0' && count < n) { *s = *t; ++s; ++t; count++; } }
相关文章推荐
- 二叉堆练习3&【模板】堆
- 线段树练习 3&P3372 【模板】线段树 1
- Java 基础一些代码练习笔记( GenericFoo<T> 泛型2)
- java例程练习(BorderLayou&GridLayout)
- 基础练习10&nbsp;十进制转十六进制
- 用1、2、2、3、4、5这六个数字,用java写一个main函数,打印出所有不同的排列,如:512234、412345等,要求:"4"不能在第三位,"3"与"5"不能相连。用1、2、2、3、4、5这六
- NBUT-2014暑期集训专题练习1 -> 二分法 N - N
- Android练习-----普通按钮(Button) && 图片按钮(ImageButton)
- 在Android上运行ClojureScript<3>
- 数据结构概述<3>链表的简单应用
- 第一章 1.4.2节练习 & 1.4.3节练习
- 练习2-2 在不使用运算符&&或|| 的条件下编写一个与上面的for循环语句等价的循环语句
- 第六章 6.4节练习 & 6.5.1节练习
- 今天的c++练习代码———>"欧几里德算法+函数的递归解决求2个整数的最大公约数"
- [C]字符串&&指针练习
- 第十章 10.2.3节练习 & 10.3.1节练习
- 论开源<3>---从公司企业的高度看开源
- Ajax&Json<3>Json
- CUDA系列学习(三)GPU设计与结构QA & coding练习
- maven 多模块&继承 及简单练习(五)