社区
新手乐园
帖子详情
关于C语言strstr函数使用的一些问题
ahahulahula
2016-12-24 03:25:14
这几天老是布置了一个作业,用strstr函数搜索二维数组中各行包含一个字符串的字符串,我定义了一个要查找的字符串riqi[20],要搜索的二维数组名是dat[][],如图,测试的时候不管如何,我的if(strstr(dat[i],riqi)!=NULL)计算机始终不执行(就是不输出1111),请问各位朋友这个什么原因?我应该如何解决?
...全文
374
3
打赏
收藏
关于C语言strstr函数使用的一些问题
这几天老是布置了一个作业,用strstr函数搜索二维数组中各行包含一个字符串的字符串,我定义了一个要查找的字符串riqi[20],要搜索的二维数组名是dat[][],如图,测试的时候不管如何,我的if(strstr(dat[i],riqi)!=NULL)计算机始终不执行(就是不输出1111),请问各位朋友这个什么原因?我应该如何解决?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
happyzeng79
2016-12-26
打赏
举报
回复
使用 strstr( &data[i][0], riqi) 这试试看。
ahahulahula
2016-12-25
打赏
举报
回复
引用 1 楼 GKatHere的回复:
riqi[0] == 0 ??????
不是应该是首地址开头吗
GKatHere
2016-12-24
打赏
举报
回复
riqi[0] == 0 ??????
关于C
语言
函数
strstr
()的分析以及实现
原型:char *
strstr
(const char *str1, const char *str2);#include
找出str2字符串在str1字符串中第一次出现的位置(不包括str2的串结束符)。返回该位置的指针,如找不到,返回空指针。Returns a pointer to the first occurrence of strSearch in str, or NULL if strSearch does not appear in str. IfstrSearch points to a string of zero length, the function r
C
语言
函数
库
函数
详细介绍手册
C
语言
常用
函数
库详细的
使用
说明 字符串
函数
bcmp bcopy bzero memccpy memchr memcmp memcpy memicmp memmove memset movmem setmem stpcpy strcat strchr strcmp strcmpi strcpy strcspn strdup stricmp strlen strlwr strncat strncmp strncmpi strncpy strnicmp strpbrk strrev strset
strstr
strtok strupr 数学
函数
abs acos asin atan atan2 ceil cos cosh exp fabs floor fmod frexp hypot ldexp log log10 modf pow pow10 sin sinh sqrt tan tanh 输入输出
函数
getchar kbhit printf putchar 系统库
函数
ClearScreen DispBCD SetScrollBar TextOut UpdateLCD bell block clrscr cursor delay get_chi_font get_eng_font getkey getpixel gotoxy line move noidle outtextxy putpixel pyfc rectangle sleep textmode time write_chi_font write_eng_font 标准
函数
exit itoa .................
C
语言
函数
速查手册
C
语言
常见的
函数
速查 字符串
函数
bcmp bcopy bzero memccpy memchr memcmp memcpy memicmp memmove memset movmem setmem stpcpy strcat strchr strcmp strcmpi strcpy strcspn strdup stricmp strlen strlwr strncat strncmp strncmpi strncpy strnicmp strpbrk strrev strset
strstr
strtok strupr 数学
函数
abs acos asin atan atan2 ceil cos cosh exp fabs floor fmod frexp hypot ldexp log log10 modf pow pow10 sin sinh sqrt tan tanh 输入输出
函数
getchar kbhit printf putchar 系统
函数
ClearScreen DispBCD SetScrollBar TextOut UpdateLCD bell block clrscr cursor delay get_chi_font get_eng_font getkey getpixel gotoxy line move noidle outtextxy putpixel pyfc rectangle sleep textmode time write_chi_font write_eng_font 系统
函数
exit itoa 字符
函数
isalnum isalpha iscntrl isdigit islower isascii isgraph isprint ispunct isspace isupper isxdigit toascii tolower toupper 内存管理
函数
calloc free malloc realloc
C
语言
常用
函数
源码 strcmp strlen atoi atol memcpy strchr
strstr
printf等等
C
语言
常用
函数
源码 strcmp strlen atoi atol memcpy strchr
strstr
printf等,不可不看.公司面试的时候很容易让写出其中某些
函数
的源码.这些
函数
的源码确实简洁,高效
C
语言
常用库
函数
C
语言
常用库
函数
主要介绍了strlen strcmp strcpy strcat
strstr
strchi atoi itoa等
函数
的实现方法。
新手乐园
33,311
社区成员
41,784
社区内容
发帖
与我相关
我的任务
新手乐园
C/C++ 新手乐园
复制链接
扫一扫
分享
社区描述
C/C++ 新手乐园
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章