Logo

Programming-Idioms

History of Idiom 39 > diff from v45 to v46

Edit summary for version 46 by programming-idioms.org:
Admin deletes impl 2042: OT

Version 45

2019-10-17, 10:52:47

Version 46

2020-05-21, 20:14:51

Idiom #39 Check if string contains a word

Set boolean ok to true if string word is contained in string s as a substring, or to false otherwise.

Idiom #39 Check if string contains a word

Set boolean ok to true if string word is contained in string s as a substring, or to false otherwise.

Variables
ok,word,s
Imports
#include<stdio.h>
#include<conio.h>
#include<string.h>
 
 
Code
int main()

{
char str[30]=”www.cprogrammingexpert.com”;
clrscr();
printf(“\n str = %s” , str);
printf(“\n strlen(str)= %d \n”,strlen(str));
getch();
return 0;
}
Doc URL
http://cprogrammingexpert.com/c-tutorial/c-string/c-strlen/
Origin
http://cprogrammingexpert.com/c-tutorial/c-string/c-strlen/