• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
zhm521
博客园 首页 新随笔 联系 订阅 订阅 管理

2020年11月17日

指针进阶
摘要: 字符指针 字符指针即可以指向单个字符,也可以指向一个字符串,一般情况下,我们更常将字符指针应用于指向一个字符串;我们要注意区分字符指针与字符数组的区别,这两个经常在使用的时候被混淆; 代码 char* pstr = "hello world"; 特别容易让我们以为是把字符串“hello world” 阅读全文
posted @ 2020-11-17 20:35 zhm521 阅读(148) 评论(0) 推荐(0)
 
strcat库函数模拟实现
摘要: //第一次尝试:#include<stdio.h> #include<stdlib.h> char* myStrcat(char* str1,const char* str2) { //参数合法性检验 if (str1 == NULL || str2 == NULL) { return NULL; 阅读全文
posted @ 2020-11-17 13:56 zhm521 阅读(152) 评论(0) 推荐(0)
 
strstr库函数模拟实现
摘要: //第一次尝试:#include<stdio.h> #include<stdlib.h> #include<string.h> #define MAX 1024 const char* myStrstr(const char* str1,const char* str2) { // 由于无法保证调用 阅读全文
posted @ 2020-11-17 12:59 zhm521 阅读(96) 评论(0) 推荐(0)
 
指针进阶的笔试题
摘要: //例题解析:#include <stdio.h> #include <stdlib.h> #include <string.h> //结构体例题 // sizeof(Test) => 20 struct Test { int Num; char* pcName; short sDate; char 阅读全文
posted @ 2020-11-17 08:31 zhm521 阅读(105) 评论(0) 推荐(0)
 
 

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3