亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如下情況如果沒有,請教哪個慕友幫忙編個這樣的函數!

如下情況如果沒有,請教哪個慕友幫忙編個這樣的函數!

C
www說 2022-12-08 17:13:38
Instr(n,s1,s2)返回在s1字符串中,從第n個字符開始,尋找s2字符,找到返回位置,找不到返回0(s2也可以是字符串(即字符數組);如果s2長度大于s1,也返回0)如Instr(2,"abcd","c")=3Instr(2,"abcd","cd")=3...
查看完整描述

2 回答

?
慕哥6287543

TA貢獻1831條經驗 獲得超10個贊

當然有:
#include <string.h>
char *strstr(const char *haystack, const char *needle);

Return
It returns a pointer into the string haystack that is the first character of
the substring, or a null pointer if no match was found. If needle is an empty
string, the function returns haystack.

Description
This is like strchr() , except that it searches haystack for a substring
needle rather than just a single character.

順便,如果你自己寫不出這樣的函數,不建議你繼續學習C。

查看完整回答
反對 回復 2022-12-10
?
慕姐8265434

TA貢獻1813條經驗 獲得超2個贊

沒有,有這個函數 
char *strchr(cs, c)
return pointer to first occurrence of c in cs or NULL if not present

查看完整回答
反對 回復 2022-12-10
  • 2 回答
  • 0 關注
  • 86 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號