//考察点1:输入参数加const

int Mystrlen(const char *str)

{//考察点2:断言字符串非0

assert(str!=NULL);

int len=0;//考察点3:一定要初始化

while((*str++)!='\0')

{

len++;

}

return len;

}

编程菜鸟的日记-初学尝试编程-编写函数实现strlen功能(总结考察点)的更多相关文章

  1. 编程菜鸟的日记-初学尝试编程-编写函数实现strcat

    #include <iostream>using namespace std;char *mystrcat(const char *str1,const char *str2){ char ...

  2. 编程菜鸟的日记-初学尝试编程-编写函数实现strcmp功能

    #include <iostream>using namespace std;int mystrcmp(const char *str1,const char *str2){ assert ...

  3. 编程菜鸟的日记-初学尝试编程-编写函数实现strcpy功能(总结考察点)

    char *Mystrcpy(char *strDest, const char *strSrc) //考察点1:将源字符串加const,表明为输入参数 {//考察点2:对源地址和目的地址的非0断言 ...

  4. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习9

    #include <iostream> #include <fstream> #include <cstdlib> #include <string> ...

  5. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习8

    #include <iostream> #include <fstream> #include <cstdlib> const int SIZE=20; using ...

  6. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习7

    #include <iostream> #include <string> #include <cctype> using namespace std; int m ...

  7. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习6

    #include <iostream> #include <string> using namespace std; const int MSIZE=100; struct j ...

  8. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习5

    #include <iostream> using namespace std; const double N1=35000; const int N2=15000; const int ...

  9. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习4

    #include <iostream> using namespace std; const int strsize=30; const int BOPSIZE=5; void showm ...

随机推荐

  1. java.io几种读写文件的方式

    一.Java把这些不同来源和目标的数据都统一抽象为数据流. Java语言的输入输出功能是十分强大而灵活的. 在Java类库中,IO部分的内容是很庞大的,因为它涉及的领域很广泛:标准输入输出,文件的操作 ...

  2. pycaffe训练的完整组件示例

    pycaffe训练的完整组件示例 为什么写这篇博客 1. 需要用到pycaffe 因为用到的开源代码基于Caffe:要维护的项目基于Caffe.基本上是用Caffe的Python接口. 2. 训练中想 ...

  3. WPF编程之找不到资源mainWindow.xaml

    原文: WPF编程之找不到资源“window1.xaml”之谜 因为将启动窗口移动到了一个新建的文件夹中,启动调试时报找不到资源mainWindow.xaml,原来是App.xaml里面设置的启动窗口 ...

  4. Principles and strategies for mathematics study

    Make mathematics study a habit with dogged perseverance Don't build mansion on top of loose sand. Co ...

  5. python 进阶读书笔记2 -- python魔法函数

    #!/usr/bin/env python# -*- coding: utf-8 -*- class student: def __init__(self, name_list): self.stud ...

  6. js前端ajax提交list集合参数至后端

    var orderNosList = new Array(); var rows = $("#dg_linkOrder").datagrid("getChecked&qu ...

  7. day23 面向对象 函数和方法区分

    最近两周内容大概回顾: # 文件操作 # # 模块:random,序列化模块,时间模块,collections,re,os,sys # 模块与包的概念和导入方法 # 写代码的规范 # 正则表达式 # ...

  8. SVM—PK—BP:SVR(better)和BP两种方法比较且实现建筑物钢筋混凝土抗压强度预测—Jason niu

    load concrete_data.mat n = randperm(size(attributes,2)); p_train = attributes(:,n(1:80))'; t_train = ...

  9. TF之RNN:matplotlib动态演示之基于顺序的RNN回归案例实现高效学习逐步逼近余弦曲线—Jason niu

    import tensorflow as tf import numpy as np import matplotlib.pyplot as plt BATCH_START = 0 TIME_STEP ...

  10. Pandas学习1 --- 数据载入

    import numpy as np import pandas as pd 数据加载 首先,我们需要将收集的数据加载到内存中,才能进行进一步的操作.pandas提供了非常多的读取数据的函数,分别应用 ...