<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>string match | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/string-match/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Tue, 06 Sep 2011 12:21:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>Program to match two given strings using function</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/string/program-match-strings-function/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/string/program-match-strings-function/#respond</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Tue, 06 Sep 2011 12:21:28 +0000</pubDate>
				<category><![CDATA[String Programs]]></category>
		<category><![CDATA[match]]></category>
		<category><![CDATA[string match]]></category>
		<category><![CDATA[string compare]]></category>
		<category><![CDATA[matchany]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=2139</guid>

					<description><![CDATA[<p>This is the program which makes use of function matchany(s1,s2) which returns the first location in the string s1 where any character from the string s2 occurs, or -1 if s1 contains no character from s2. #include "stdio.h" #include "conio.h" #include "string.h" void main() { int matchany(char str1[],char str2[]);//function declaration char str1[50],str2[50]; int s; clrscr();</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/program-match-strings-function/">Program to match two given strings using function</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This is the program which makes use of function matchany(s1,s2) which returns the first location in the string s1 where any character from the string s2 occurs, or -1 if s1 contains no character from s2.</p>
<pre lang="c" escaped="true" line="1">
#include "stdio.h"
#include "conio.h"
#include "string.h"
void main()
{
 int matchany(char str1[],char str2[]);//function declaration
 char str1[50],str2[50];
 int s;
 clrscr();
 printf("Enter string 1 and string 2\n");
 scanf("%s%s",&amp;str1,&amp;str2);
 s=matchany(str1,str2);
 if(s==-1)
 printf("\nNo match found");
 else
 printf("\nThe location where the first match occured is %d",s);
 getch();
}

int matchany(char str1[],char str2[])
{
 int i,j;
 for(i=0;i&lt;strlen(str2);i++)
 {
  for(j=0;j&lt;strlen(str1);j++)
  {
   if(str2[i]==str1[j])
   {
    return j+1;
   }
  }
 }
 return -1;
}
</pre>
<p><strong>output 1:</strong></p>
<pre lang="c" escaped="true">
Enter string 1 and string 2
hello
world
The location where the first match occured is 5  
</pre>
<p><strong>Output 2:</strong></p>
<pre lang="c" escaped="true">
Enter string 1 and string 2
ice
smooth
No match found
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/program-match-strings-function/">Program to match two given strings using function</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c/string/program-match-strings-function/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
