<?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>C/C++ Programms | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/cc-programms/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 16 May 2009 13:58:21 +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>To reverse the given string using pointer</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/string/to-reverse-the-given-string-using-pointer/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/string/to-reverse-the-given-string-using-pointer/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 04 Dec 2008 09:18:53 +0000</pubDate>
				<category><![CDATA[String Programs]]></category>
		<category><![CDATA[Source Codes]]></category>
		<category><![CDATA[C/C++ Programms]]></category>
		<category><![CDATA[C/C++]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=412</guid>

					<description><![CDATA[<p>This is the program to reverse the given string and display. The program internally uses the logic of reversing the word. Logic: The approach here is to reverse the string using the pointers. Reversing the string includes the reversing the each and every words in it. After accepting a string from user, it calls a</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/to-reverse-the-given-string-using-pointer/">To reverse the given string using pointer</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This is the program to reverse the given string and display. The program internally uses the logic of reversing the word.</p>
<p>Logic: The approach here is to reverse the string using the pointers. Reversing the string includes the reversing the each and every words in it. After accepting a string from user, it calls a function &#8220;strev&#8221; with two string pointer arguments, the source and destination. It has an iterative loop, which traces from the EOL through the beginning. Each time it copies the current letter to the destination. Finally it displays the resultant string.</p>
<p>The earlier program implements the same by direct method, i.e. without pointers.</p>
<pre>#include&lt;stdio.h&gt;
#include&lt;conio.h&gt;
void strev(char *str1, char *str2);
void main()
{
        char *str1, *str2;
        clrscr();
        printf("\n\n\t ENTER A STRING...: ");
        gets(str1);
        strev(str1,str2);
        printf("\n\t THE REVERSED STRING IS...: ");
        puts(str2);
        getch();
}

void strev(char *str1, char *str2)
{
        int i = 0, len = 0, r = 0;
        while(*(str1+len)!='\0')
                len++;
        for(i=len-1; i&gt;=0; i--)
        {
                *(str2+r) = *(str1+i);
                r++;
        }
        *(str2+r) = '\0';
}</pre>
<p><a href="https://studentprojects.in/wp-content/uploads/2008/12/strp_rev.zip"><img decoding="async" loading="lazy" class="size-medium wp-image-443" title="String Reverse C program" src="https://studentprojects.in/wp-content/uploads/2009/02/download_icon.gif" border="0" alt="" width="131" height="53" /></a></p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/to-reverse-the-given-string-using-pointer/">To reverse the given string using pointer</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/to-reverse-the-given-string-using-pointer/feed/</wfw:commentRss>
			<slash:comments>9</slash:comments>
		
		
			</item>
		<item>
		<title>To reverse the given string</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/string/to-reverse-the-given-string/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/string/to-reverse-the-given-string/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 04 Dec 2008 09:15:40 +0000</pubDate>
				<category><![CDATA[String Programs]]></category>
		<category><![CDATA[Source Codes]]></category>
		<category><![CDATA[C/C++ Programms]]></category>
		<category><![CDATA[C/C++]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=409</guid>

					<description><![CDATA[<p>Here is the program to reverse the given string and display. The program internally uses the logic of reversing the word. Logic: Reversing the string includes the reversing the each and every words in it. After accepting a string from user, it calls a function &#8220;strev&#8221; with two string arguments, the source and destination. It</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/to-reverse-the-given-string/">To reverse the given string</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Here is the program to reverse the given string and display. The program internally uses the logic of reversing the word.</p>
<p>Logic: Reversing the string includes the reversing the each and every words in it. After accepting a string from user, it calls a function &#8220;strev&#8221; with two string arguments, the source and destination. It has an iterative loop, which traces from the EOL through the begining. Each time it copies the current letter to the destination. Finally it displays the resultant string.</p>
<p>The same program is implemented using the string pointers.</p>
<p>#include&lt;stdio.h&gt;<br />
#include&lt;conio.h&gt;<br />
void strev(char str1[50], char str2[50]);<br />
void main()<br />
{<br />
char str1[50], str2[50];<br />
clrscr();<br />
printf(&#8220;\n\n\t ENTER A STRING&#8230;: &#8220;);<br />
gets(str1);<br />
strev(str1,str2);<br />
printf(&#8220;\n\t THE REVERSED STRING IS&#8230;: &#8220;);<br />
puts(str2);<br />
getch();<br />
}<br />
void strev(char str1[50], char str2[50])<br />
{<br />
int i = 0, len = 0, r = 0;<br />
while(str1[len]!=&#8217;\0&#8242;)<br />
len++;<br />
for(i=len-1; i&gt;=0; i&#8211;)<br />
{<br />
str2[r] = str1[i];<br />
r++;<br />
}<br />
str2[r] = &#8216;\0&#8217;;<br />
}<br />
<a href="https://studentprojects.in/wp-content/uploads/2008/12/str_rev.zip">Download exe and source code here.</a></p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/to-reverse-the-given-string/">To reverse the given string</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/to-reverse-the-given-string/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>To copy the contents of one string to another string using pointer</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/string/to-copy-the-contents-of-one-string-to-another-string-using-pointer/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/string/to-copy-the-contents-of-one-string-to-another-string-using-pointer/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 04 Dec 2008 09:07:10 +0000</pubDate>
				<category><![CDATA[String Programs]]></category>
		<category><![CDATA[Source Codes]]></category>
		<category><![CDATA[C/C++ Programms]]></category>
		<category><![CDATA[C/C++]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=405</guid>

					<description><![CDATA[<p>This is the simple implementation of the &#8220;Copy&#8221; function using the pointers. This program copies the content of one string to another. Logic : The program asks the user to input the string to copy and stores using the pointer str1. The inner function &#8220;stcpy&#8221; takes 2 string pointers as arguments. By keeping the length</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/to-copy-the-contents-of-one-string-to-another-string-using-pointer/">To copy the contents of one string to another string using pointer</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This is the simple implementation of the &#8220;Copy&#8221; function using the pointers. This program copies the content of one string to another.</p>
<p>Logic : The program asks the user to input the string to copy and stores using the pointer str1. The inner function &#8220;stcpy&#8221; takes 2 string pointers as arguments. By keeping the length as the reference, it traces till EOF , for each i of this iteration it copies the i-th  letter to the destination string, i.e str2. After the EOL, it puts a NULL to the second line. That gives the duplicated string of the entered.</p>
<p>This function copies the string using the pointer, where earlier program copies the string directly.</p>
<p>#include&lt;stdio.h&gt;<br />
#include&lt;conio.h&gt;<br />
void stcpy(char *str1, char *str2);<br />
void main()<br />
{<br />
char *str1, *str2;<br />
clrscr();<br />
printf(&#8220;\n\n\t ENTER A STRING&#8230;: &#8220;);<br />
gets(str1);<br />
stcpy(str1,str2);<br />
printf(&#8220;\n\t THE COPIED STRING IS&#8230;: &#8220;);<br />
puts(str2);<br />
getch();<br />
}<br />
void stcpy(char *str1, char *str2)<br />
{<br />
int i, len = 0;<br />
while(*(str1+len)!=&#8217;\0&#8242;)<br />
len++;<br />
for(i=0;i&lt;len;i++)<br />
*(str2+i) = *(str1+i);<br />
*(str2+i) = &#8216;\0&#8217;;<br />
}<br />
<a href="https://studentprojects.in/wp-content/uploads/2008/12/strp_cpy.zip">Download exe and source code here.</a></p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/to-copy-the-contents-of-one-string-to-another-string-using-pointer/">To copy the contents of one string to another string using pointer</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/to-copy-the-contents-of-one-string-to-another-string-using-pointer/feed/</wfw:commentRss>
			<slash:comments>13</slash:comments>
		
		
			</item>
		<item>
		<title>To copy the contents of one string to another string</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/string/to-copy-the-contents-of-one-string-to-another-string/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/string/to-copy-the-contents-of-one-string-to-another-string/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 04 Dec 2008 09:04:07 +0000</pubDate>
				<category><![CDATA[String Programs]]></category>
		<category><![CDATA[Source Codes]]></category>
		<category><![CDATA[C/C++ Programms]]></category>
		<category><![CDATA[C/C++]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=402</guid>

					<description><![CDATA[<p>This is the simple implementation of the &#8220;Copy&#8221; function of the computer world. This program copies the content of one string to another. Logic : The program asks the user to input the string to copy and stores this as str1. The inner function &#8220;stcpy&#8221; takes 2 strings as arguments. By keeping the length as</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/to-copy-the-contents-of-one-string-to-another-string/">To copy the contents of one string to another string</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This is the simple implementation of the &#8220;Copy&#8221; function of the computer world. This program copies the content of one string to another.</p>
<p>Logic : The program asks the user to input the string to copy and stores this as str1. The inner function &#8220;stcpy&#8221; takes 2 strings as arguments. By keeping the length as the reference, it traces till EOL , for each i of this iteration, it copies the i-th  letter to the destination string, i.e str2.</p>
<p>After the EOL, it puts a NULL to the second line. That gives the duplicated string of the entered.</p>
<p>#include&lt;stdio.h&gt;<br />
#include&lt;conio.h&gt;<br />
void stcpy(char str1[50], char str2[50]);<br />
void main()<br />
{<br />
char str1[50], str2[50];<br />
clrscr();<br />
printf(&#8220;\n\n\t ENTER A STRING&#8230;: &#8220;);<br />
gets(str1);<br />
stcpy(str1,str2);<br />
printf(&#8220;\n\t THE COPIED STRING IS&#8230;: &#8220;);<br />
puts(str2);<br />
getch();<br />
}<br />
void stcpy(char str1[50], char str2[50])<br />
{<br />
int i, len = 0;<br />
while(str1[len]!=&#8217;\0&#8242;)<br />
len++;<br />
for(i=0;i&lt;len;i++)<br />
str2[i] = str1[i];<br />
str2[i] = &#8216;\0&#8217;;<br />
}<br />
<a href="https://studentprojects.in/wp-content/uploads/2008/12/str_cpy.zip">Download exe and source code here.</a></p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/to-copy-the-contents-of-one-string-to-another-string/">To copy the contents of one string to another string</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/to-copy-the-contents-of-one-string-to-another-string/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>To check whether the given string is palindrome-method 2</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/string/to-check-whether-the-given-string-is-palindrome-method-2/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/string/to-check-whether-the-given-string-is-palindrome-method-2/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 04 Dec 2008 09:00:20 +0000</pubDate>
				<category><![CDATA[String Programs]]></category>
		<category><![CDATA[C/C++ Programms]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Source Codes]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=398</guid>

					<description><![CDATA[<p>Here is  another program, advanced version of the previous program, to check if the entered string is a palindrome. Palindrome is a string segment, which reads same from both the directions. The same method is implemented here in the program also. Logic :  The given string is referred by two names, where one is traced</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/to-check-whether-the-given-string-is-palindrome-method-2/">To check whether the given string is palindrome-method 2</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Here is  another program, advanced version of the previous program, to check if the entered string is a palindrome. Palindrome is a string segment, which reads same from both the directions. The same method is implemented here in the program also.</p>
<p>Logic :  The given string is referred by two names, where one is traced by the SOL (Start Of Line) and the other is traced from EOL (End Of Line). In every iteration, the condition is checked, if both the characters are the same. If so, sets a flag, &#8220;pal&#8221; as true (i.e. 1), and hence prints out the result.</p>
<p>The problem can also solved in another method, where we check  by reversing the string and then comparing.</p>
<p>#include&lt;stdio.h&gt;<br />
#include&lt;conio.h&gt;<br />
int stpal(char str[50]);<br />
void main()<br />
{<br />
char str[50];<br />
int pal;<br />
clrscr();<br />
printf(&#8220;\n\n\t ENTER A STRING&#8230;: &#8220;);<br />
gets(str);<br />
pal = stpal(str);<br />
if(pal)<br />
printf(&#8220;\n\t THE ENTERED STRING IS A PALINDROME&#8221;);<br />
else<br />
printf(&#8220;\n\t THE ENTERED STRING IS NOT A PALINDROME&#8221;);<br />
getch();<br />
}<br />
int stpal(char str[50])<br />
{<br />
int i = 0, len = 0, pal = 1;<br />
while(str[len]!=&#8217;\0&#8242;)<br />
len++;<br />
len&#8211;;<br />
for(i=0; i&lt;len/2; i++)<br />
{<br />
if(str[i] == str[len-i])<br />
pal = 1;<br />
else<br />
{<br />
pal = 0;<br />
break;<br />
}<br />
}<br />
return pal;<br />
}<br />
<a href="https://studentprojects.in/wp-content/uploads/2008/12/str_2pal.zip">Download exe and source code here.</a></p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/to-check-whether-the-given-string-is-palindrome-method-2/">To check whether the given string is palindrome-method 2</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/to-check-whether-the-given-string-is-palindrome-method-2/feed/</wfw:commentRss>
			<slash:comments>13</slash:comments>
		
		
			</item>
		<item>
		<title>To check whether the given string is palindrome-method 1</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/string/to-check-whether-the-given-string-is-palindrome/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/string/to-check-whether-the-given-string-is-palindrome/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 04 Dec 2008 08:57:00 +0000</pubDate>
				<category><![CDATA[String Programs]]></category>
		<category><![CDATA[C/C++ Programms]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Source Codes]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=395</guid>

					<description><![CDATA[<p>Here is  the program to check if the entered string is a palindrome or not. As we have seen in the earlier cases, Palindrome is a string segment, which reads same from both the directions. The same method is implemented here in the program also. Logic :  The given string is reversed using a method,</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/to-check-whether-the-given-string-is-palindrome/">To check whether the given string is palindrome-method 1</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Here is  the program to check if the entered string is a palindrome or not. As we have seen in the earlier cases, Palindrome is a string segment, which reads same from both the directions. The same method is implemented here in the program also.</p>
<p>Logic :  The given string is reversed using a method, which puts the reversed string in the resultant string from the EOL (End Of Line). After reversing, it compares if strings are one and the same. If so, sets a flag, &#8220;pal&#8221; as true (i.e. 1), and hence prints out the result.</p>
<p>The problem can also solved in a bit sophisticated method, where we check  without reversing the string, but directly.</p>
<p>#include&lt;stdio.h&gt;<br />
#include&lt;conio.h&gt;<br />
int stpal(char str1[50], char str2[50]);<br />
void main()<br />
{<br />
char str[50], rev[50];<br />
int pal;<br />
clrscr();<br />
printf(&#8220;\n\n\t ENTER A STRING&#8230;: &#8220;);<br />
gets(str);<br />
pal = stpal(str, rev);<br />
printf(&#8220;\n\t THE REVERSED STRING IS&#8230;: &#8220;);<br />
puts(rev);<br />
if(pal)<br />
printf(&#8220;\n\t THE ENTERED STRING IS A PALINDROME&#8221;);<br />
else<br />
printf(&#8220;\n\t THE ENTERED STRING IS NOT A PALINDROME&#8221;);<br />
getch();<br />
}<br />
int stpal(char str1[50], char str2[50])<br />
{<br />
int i = 0, len = 0, r = 0, pal = 1;<br />
while(str1[len]!=&#8217;\0&#8242;)<br />
len++;<br />
for(i=len-1; i&gt;=0; i&#8211;)<br />
{<br />
str2[r] = str1[i];<br />
r++;<br />
}<br />
str2[r] = &#8216;\0&#8217;;<br />
for(i=0; i&lt;=len-1; i++)<br />
{<br />
if(str1[i] == str2[i])<br />
pal = 1;<br />
else<br />
{<br />
pal = 0;<br />
break;<br />
}<br />
}<br />
return pal;<br />
}</p>
<p><a href="https://studentprojects.in/wp-content/uploads/2008/12/str_1pal.zip">Download exe and source code here.</a></p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/to-check-whether-the-given-string-is-palindrome/">To check whether the given string is palindrome-method 1</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/to-check-whether-the-given-string-is-palindrome/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>To replace a word by another word in a given string</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/string/to-replace-a-word-by-another-word-in-a-given-string/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/string/to-replace-a-word-by-another-word-in-a-given-string/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 04 Dec 2008 08:28:47 +0000</pubDate>
				<category><![CDATA[String Programs]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[C/C++ Programms]]></category>
		<category><![CDATA[Source Codes]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=392</guid>

					<description><![CDATA[<p>#include&#60;stdio.h&#62; #include&#60;conio.h&#62; int stlen(char str[50]) { int len = 0; while(str[len]!=&#8217;\0&#8242;) len++; len&#8211;; return len; } void stcat(char str1[50], char str2[50]) { int i = 0,len = 0; while(str1[len]!=&#8217;\0&#8242;) len++; while(str2[i]!=&#8217;\0&#8242;) { str1[len] = str2[i]; i++; len++; } str1[len] = &#8216;\0&#8217;; } void main() { char str1[50], str2[50], str3[50], temp[50]; int len1, len2, len3, i,</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/to-replace-a-word-by-another-word-in-a-given-string/">To replace a word by another word in a given string</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>#include&lt;stdio.h&gt;<br />
#include&lt;conio.h&gt;<br />
int stlen(char str[50])<br />
{<br />
int len = 0;<br />
while(str[len]!=&#8217;\0&#8242;)<br />
len++;<br />
len&#8211;;<br />
return len;<br />
}<span id="more-392"></span><br />
void stcat(char str1[50], char str2[50])<br />
{<br />
int i = 0,len = 0;<br />
while(str1[len]!=&#8217;\0&#8242;)<br />
len++;<br />
while(str2[i]!=&#8217;\0&#8242;)<br />
{<br />
str1[len] = str2[i];<br />
i++;<br />
len++;<br />
}<br />
str1[len] = &#8216;\0&#8217;;<br />
}<br />
void main()<br />
{<br />
char str1[50], str2[50], str3[50], temp[50];<br />
int len1, len2, len3, i, j, match, k;<br />
clrscr();<br />
printf(&#8220;\n\n\t ENTER A SENTENCE&#8230;: &#8220;);<br />
gets(str1);<br />
len1 = stlen(str1);<br />
printf(&#8220;\n\n\t ENTER A STRING WHICH YOU WANT TO DELETE&#8230;: &#8220;);<br />
gets(str2);<br />
len2 = stlen(str2);<br />
printf(&#8220;\n\n\t ENTER A NEW STRING WHICH YOU WANT TO INSERT &#8230;: &#8220;);<br />
gets(str3);<br />
len3 = stlen(str3);<br />
for(i=0;i&lt;=len1;i++)<br />
{<br />
match = 1;<br />
for(j=0;j&lt;=len2;j++)<br />
if(str2[j]!=str1[i+j])<br />
{<br />
match = 0;<br />
break;<br />
}<br />
if(match)<br />
{<br />
for(k=0,j=i+len2+1;j&lt;=len1;j++,k++)<br />
temp[k] = str1[j];<br />
temp[k] = &#8216;\0&#8217;;<br />
for(j=0;j&lt;=len3;j++)<br />
str1[i+j] = str3[j];<br />
str1[i+j] = &#8216;\0&#8217;;<br />
stcat(str1,temp);<br />
len1 = len1 &#8211; len2 +len3;<br />
i = i + j;<br />
}<br />
}<br />
printf(&#8220;\n\n\t OUTPUT IS&#8230;: &#8220;);<br />
puts(str1);<br />
getch();<br />
}<br />
<a href="https://studentprojects.in/wp-content/uploads/2008/12/str_rplc.zip">Download exe and source code here.</a></p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/to-replace-a-word-by-another-word-in-a-given-string/">To replace a word by another word in a given string</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/to-replace-a-word-by-another-word-in-a-given-string/feed/</wfw:commentRss>
			<slash:comments>10</slash:comments>
		
		
			</item>
		<item>
		<title>Program to concatenate two given string using Pointer</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/string/program-to-concatenate-two-given-string-using-pointer/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/string/program-to-concatenate-two-given-string-using-pointer/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 04 Dec 2008 08:24:18 +0000</pubDate>
				<category><![CDATA[String Programs]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[C/C++ Programms]]></category>
		<category><![CDATA[Source Codes]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=388</guid>

					<description><![CDATA[<p>This is another example program to concatenate two given strings dynamically using the string pointers. Earlier program explains the way to concatenate two strings by direct method. Logic : The program is just up gradation of the previous program. Here the program takes two strings to concatenate. Stores that with pointers str1 and str2 pointed</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/program-to-concatenate-two-given-string-using-pointer/">Program to concatenate two given string using Pointer</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This is another example program to concatenate two given strings dynamically using the string pointers. Earlier program explains the way to concatenate two strings by direct method.</p>
<p>Logic : The program is just up gradation of the previous program. Here the program takes two strings to concatenate. Stores that with pointers str1 and str2 pointed to that respectively. The function &#8220;stcat&#8221; takes 2 pointer argument and keeping one as the reference, traces the other till the end. The EOL (End Of Line) of the first string is taken and then the second string is added at this point, character by character. This inner loop will iterate till the EOL of the second line. After the end of the second string, an EOL will be added. Finally, the result will be displayed.</p>
<p>#include&lt;stdio.h&gt;<br />
#include&lt;conio.h&gt;<br />
void stcat(char *str1, char *str2);<br />
void main()<br />
{<br />
char *str1, *str2;<br />
clrscr();<br />
printf(&#8220;\n\n\t ENTER THE FIRST STRING&#8230;: &#8220;);<br />
gets(str1);<br />
printf(&#8220;\n\n\t ENTER THE FIRST STRING&#8230;: &#8220;);<br />
gets(str2);<br />
stcat(str1,str2);<br />
printf(&#8220;\n\t THE CONCATENATED STRING IS&#8230;: &#8220;);<br />
puts(str1);<br />
getch();<br />
}<br />
void stcat (char *str1, char *str2)<br />
{<br />
int i = 0,len = 0;<br />
while(*(str1+len)!=&#8217;\0&#8242;)<br />
len++;<br />
while(*(str2+i)!=&#8217;\0&#8242;)<br />
{<br />
*(str1+len) = *(str2+i);<br />
i++;<br />
len++;<br />
}<br />
*(str1+len) = &#8216;\0&#8217;;<br />
}<br />
<a href="https://studentprojects.in/wp-content/uploads/2008/12/strp_cat1.zip">Download exe and source code here.</a></p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/program-to-concatenate-two-given-string-using-pointer/">Program to concatenate two given string using Pointer</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-to-concatenate-two-given-string-using-pointer/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Program to concatenate two given string</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/string/program-to-concatenate-two-given-string/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/string/program-to-concatenate-two-given-string/#respond</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 04 Dec 2008 08:20:05 +0000</pubDate>
				<category><![CDATA[String Programs]]></category>
		<category><![CDATA[Source Codes]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[C/C++ Programms]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=385</guid>

					<description><![CDATA[<p>This is the example program to concatenate two given strings dynamically, i.e. at the run time. Concatenating simply means that appending one string to another. Logic : Here the logic is simple that the program asks the user to enter the first string, succeeded by the  second string to concatenate. The EOL (End Of Line)</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/program-to-concatenate-two-given-string/">Program to concatenate two given string</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This is the example program to concatenate two given strings dynamically, i.e. at the run time. Concatenating simply means that appending one string to another.</p>
<p>Logic : Here the logic is simple that the program asks the user to enter the first string, succeeded by the  second string to concatenate. The EOL (End Of Line) of the first string is taken and then the second string is added at this point, character by character. This loop will iterate till the EOL of the second line. After the end of the second string, an EOL will be added. Finally, the result will be displayed.</p>
<p>#include&lt;stdio.h&gt;<br />
#include&lt;conio.h&gt;<br />
void stcat(char str1[50], char str2[50]);<br />
void main()<br />
{<br />
char str1[50], str2[50];<br />
clrscr();<br />
printf(&#8220;\n\n\t ENTER THE FIRST STRING&#8230;: &#8220;);<br />
gets(str1);<br />
printf(&#8220;\n\n\t ENTER THE FIRST STRING&#8230;: &#8220;);<br />
gets(str2);<br />
stcat(str1,str2);<br />
printf(&#8220;\n\t THE CONCATENATED STRING IS&#8230;: &#8220;);<br />
puts(str1);<br />
getch();<br />
}<br />
void stcat(char str1[50], char str2[50])<br />
{<br />
int i = 0,len = 0;<br />
while(str1[len]!=&#8217;\0&#8242;)<br />
len++;<br />
while(str2[i]!=&#8217;\0&#8242;)<br />
{<br />
str1[len] = str2[i];<br />
i++;<br />
len++;<br />
}<br />
str1[len] = &#8216;\0&#8217;;<br />
}<br />
<a href="https://studentprojects.in/wp-content/uploads/2008/12/str_cat.zip">Download exe and source code here.</a></p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/program-to-concatenate-two-given-string/">Program to concatenate two given string</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-to-concatenate-two-given-string/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Program to find the total number of palindrome in a given string</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/string/program-to-find-the-total-number-of-palindrome-in-a-given-string/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/string/program-to-find-the-total-number-of-palindrome-in-a-given-string/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 04 Dec 2008 08:17:22 +0000</pubDate>
				<category><![CDATA[String Programs]]></category>
		<category><![CDATA[Source Codes]]></category>
		<category><![CDATA[C/C++ Programms]]></category>
		<category><![CDATA[C/C++]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=382</guid>

					<description><![CDATA[<p>Here is  the program to find the total number of palindromes present in the entered sentence.  This program internally uses the logic to find the palindrome, discussed earlier. Logic :  The given string is traced word-by-word till the EOL. To trace the words, it uses the logic of earlier program, where we counted the number</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/program-to-find-the-total-number-of-palindrome-in-a-given-string/">Program to find the total number of palindrome in a given string</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Here is  the program to find the total number of palindromes present in the entered sentence.  This program internally uses the logic to find the palindrome, discussed earlier.</p>
<p>Logic :  The given string is traced word-by-word till the EOL. To trace the words, it uses the logic of earlier program, where we counted the number of words. Each time, Each time, when we find the full word, we pass the ord to the internal block which checks if the word is a palindrome or not, the logic discussed earlier.</p>
<p>#include&lt;stdio.h&gt;<br />
#include&lt;conio.h&gt;<br />
int stpal(char str[50], int st, int ed);<br />
void main()<br />
{<br />
char str[50];<br />
int pal = 0, len = 0, i, start = 0, end;<br />
clrscr();<br />
printf(&#8220;\n\n\t ENTER A SENTENCE&#8230;: &#8220;);<br />
gets(str);<br />
while(str[len]!=&#8217;\0&#8242;)<br />
len++;<br />
len&#8211;;<br />
for(i=0;i&lt;=len;i++)<br />
{<br />
if((str[i] == &#8216; &#8216; &amp;&amp; str[i+1] != &#8216; &#8216;) || i == len)<br />
{<br />
if(i == len)<br />
end = i;<br />
else<br />
end = i &#8211; 1;<br />
if( stpal (str, start, end ) )<br />
pal++;<br />
start = end + 2;<br />
}<br />
}<br />
printf(&#8220;\n\n\t THE TOTAL NUMBER OF PALINDROMES ARE..: %d&#8221;,pal);<br />
getch();<br />
}<br />
int stpal(char str[50], int st, int ed)<br />
{<br />
int i, pal=0;<br />
for(i=0; i&lt;=(ed-st)/2; i++)<br />
{<br />
if(str[st+i] == str[ed-i])<br />
pal = 1;<br />
else<br />
{<br />
pal = 0;<br />
break;<br />
}<br />
}<br />
return pal;<br />
}<br />
<a href="https://studentprojects.in/wp-content/uploads/2008/12/str_tlpl.zip">Download exe and source code here.</a></p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/program-to-find-the-total-number-of-palindrome-in-a-given-string/">Program to find the total number of palindrome in a given string</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-to-find-the-total-number-of-palindrome-in-a-given-string/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
