首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
实现strstr功能(寻找子串在父串中首次出现的位置)
实现strstr功能(寻找子串在父串中首次出现的位置)
admin
2019-03-29
116
问题
实现strstr功能(寻找子串在父串中首次出现的位置)
选项
答案
char * strstring(char *ParentString, char *SubString) { char *pSubString, *pPareString; for(char *pTmp=ParentString; *pTmp; pTmp++) { pSubString = SubString; pPareString = pTmp; while(*pSubString == *pPareString && *pSubString != ’\0’) { pSubString++; pPareString++; } if(*pSubString == ’\0’) return pTmp; } return NULL; } int main(int argc, char* argv[]) { char *ParentString = "happy birthday to you!"; char *SubString = "birthday"; printf("%s",strstring(ParentString, SubString)); return getchar(); }}
解析
转载请注明原文地址:https://kaotiyun.com/show/vxmZ777K
0
程序员面试
相关试题推荐
TheGreeksassumedthatthestructureoflanguagehadsomeconnectionwiththeprocessofthought,whichtookrootinEuropelon
ApplicationWriteanapplicationofabout100wordsbasedonthefollowingsituation:Youwishtojointhedanceclubof
TheSecondWorldWar,______theearlieronein1914,promptedpublicconcernaboutthephysicalandintellectualwell-beingoft
Americanschoolsaren’texactlyfrozenintime,butconsideringthepaceofchangeinotherareasoflife,ourpublicschoolste
[A]TherelativelylowtuitionfeesinAsiaarealsoamaindrawforprospectivestudents.Lastyear,onlinehighereducationre
实现strstr功能(寻找子串在父串中首次出现的位置)
求两个串中的第一个最长子串(神州数码以前试题)。如"abractyeyt","dgdsaeactyey"的最大子串为"actyet"。
设置围绕表格的边框宽度的HTML代码是______。A.tablesize=#B.tableborder=#C.tablebordersize=#D.tableborder=#
当线性表采用顺序存储结构实现存储时,其主要特点是
在Excel2003中,按住鼠标左键直接拖动填充柄在相邻的多个单元格中填充数据序列,以下具有自动加1可能的是()。
随机试题
以下描述完整准确的护理目标是
急性化脓性腱鞘炎,提倡早期切开,主要是为了避免
测定片剂等固体制剂的溶出度时,温度影响药物的溶出率,因此《中国药典》(2000年版)规定测定时的温度是
决定居住区居住密度的重要指标是()。
目前,我国公募基金销售机构不包括()。
根据《贷款通则》的规定,贷款期限根据借款人的生产经营周期、还款能力和银行的资金供给能力由借贷双方共同商议后确定,并在借款合同中载明。()
采取频繁的反馈和根据每个人的需要因人而异地进行评价,这属于()
以下是王某和110报警服务台接警员之间的对话:王某:“喂,公安局吗?请你们赶快来救火!”接警员:“你是谁呀?哪里啊?”王某:“我家!”接警员:“我是问具体哪里着火了啊?”王某:“厨房,我家煤气瓶着火了,快来
下列对于线性链表的描述中正确的是
TheEuropeanUnion(EU)isabouttoundertakethebiggestenlargementofitsbordersever.【S1】______in1957with6membercountrie
最新回复
(
0
)