b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

strchr函数php_c++ strchr函数_strchr函数每一次出现

电脑杂谈  发布时间:2017-02-21 01:00:35  来源:网络整理

c++ strchr函数_strchr函数每一次出现_strchr函数php

c++ strchr函数c++ strchr函数

// 模拟实现strchr函数,功能:在一个字符串中查找一个字符第一次出现的位置,如果没有出现返回NULL#include <stdio.h>#include <assert.h>char const* my_strchr(char const *p,char c){ assert(p != NULL); while (*p) { if (*p == c) return p; else p++; } return NULL;}int main(){ char *p = "zhaoyaqian"; printf("字符串是:%s\n", p); printf("位置:%p\n", my_strchr(p, a)); printf("位置:%p\n", my_strchr(p, c)); return 0;}<img src="?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemhhb3lhcWlhbjU1Mg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-33576-1.html

    相关阅读
      发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

      热点图片
      拼命载入中...