<?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 Programs | Student Projects</title>
	<atom:link href="https://studentprojects.in/category/software-development/c-tutorials/c/string/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sun, 11 Dec 2022 10:12:25 +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>C Program to implement newStringCopy and newStringConcatenate functions</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/string/c-program-to-implement-newstringcopy-and-newstringconcatenate-functions/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/string/c-program-to-implement-newstringcopy-and-newstringconcatenate-functions/#respond</comments>
		
		<dc:creator><![CDATA[Ansten Lobo]]></dc:creator>
		<pubDate>Sat, 09 Jun 2012 15:27:10 +0000</pubDate>
				<category><![CDATA[String Programs]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3290</guid>

					<description><![CDATA[<p>Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT #include void newStrCpy(char *,char *); void newStrCat(char *,char *); void main() { char str1[80],str2[80]; int opn; do { printf("Press 1- NewStrCpy \t 2- NewStrCat\t 3- Exit\t Your Option?"); scanf("%d",&#038;opn); switch(opn) { case 1: flushall(); printf("\n Read the Source String \n"); gets(str1); newStrCpy(str2,str1); printf("</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/c-program-to-implement-newstringcopy-and-newstringconcatenate-functions/">C Program to implement newStringCopy and newStringConcatenate functions</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT</p>
<pre lang="C" line="1">
#include <stdio.h>

void newStrCpy(char *,char *);
void newStrCat(char *,char *);

void main()
{
    char str1[80],str2[80];
    int opn;
    do
    {
        printf("Press 1- NewStrCpy \t 2- NewStrCat\t 3- Exit\t Your Option?");
        scanf("%d",&opn);
        switch(opn)
        {
        case 1: flushall();
            printf("\n Read the Source String \n");
            gets(str1);
            newStrCpy(str2,str1);
            printf(" Copied String: %s\n",str2);
            break;
        case 2: flushall();
            printf(" Read the First String \n");
            gets(str1);
            printf(" Read the Second String \n");
            gets(str2);
            newStrCat(str1,str2);
            printf("Concatenated String: \n");
            puts(str1);
            break;
        case 3: printf(" Exit!! Press a key . . .");
            getch();
            break;
        default: printf(" Invalid Option!!! Try again !!!\n");
            break;
        }
    }while(opn != 3);
}   /* End of main() */

void newStrCpy(char *d,char *s)
{
    while( (*d++ = *s++));
}
void newStrCat(char *s, char *t)
{
    while(*s)
        s++;
    while(*s++ = *t++);
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/c-program-to-implement-newstringcopy-and-newstringconcatenate-functions/">C Program to implement newStringCopy and newStringConcatenate functions</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/c-program-to-implement-newstringcopy-and-newstringconcatenate-functions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Program to replace each string of one or more blanks by a single blank</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/string/program-replace-string-blanks-single-blank-2/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/string/program-replace-string-blanks-single-blank-2/#respond</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Tue, 06 Sep 2011 13:06:31 +0000</pubDate>
				<category><![CDATA[String Programs]]></category>
		<category><![CDATA[string programs]]></category>
		<category><![CDATA[replace bank]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=2151</guid>

					<description><![CDATA[<p>Here is the program to replace each string of one or more blanks by a single blank. Output:</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/program-replace-string-blanks-single-blank-2/">Program to replace each string of one or more blanks by a single blank</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Here is the program to replace each string of one or more blanks by a single blank.</p>



<pre class="wp-block-code"><code lang="c" class="language-c">#include "stdio.h"
#include "string.h"
int
main ()
{
  char input[100], output[100], c;
  int i = 0, j = 0;
  printf ("Enter the string\n");
  gets (input);
  for (i = 0; i &lt; strlen (input); i++)
    {
      if (input[i] == ' ' &amp;&amp; input[i + 1] != ' ')
          output[j++] = input[i];
      else if (input[i] != ' ')
          output[j++] = input[i];
    }

  printf ("\noutput string is\n");
  puts (output);
}
</code></pre>



<p><strong>Output:</strong></p>



<pre class="wp-block-code"><code class="">Enter the string
How          are                 you         ?
Output string is: How are you ? </code></pre>



<p></p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/program-replace-string-blanks-single-blank-2/">Program to replace each string of one or more blanks by a single blank</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-replace-string-blanks-single-blank-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<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>
		<item>
		<title>Program to arrange the string in alphabetical order</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/string/program-arrange-string-alphabetical-order/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/string/program-arrange-string-alphabetical-order/#respond</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Tue, 30 Aug 2011 14:24:39 +0000</pubDate>
				<category><![CDATA[String Programs]]></category>
		<category><![CDATA[string sorting]]></category>
		<category><![CDATA[alphabetical]]></category>
		<category><![CDATA[string programs]]></category>
		<category><![CDATA[sorting]]></category>
		<category><![CDATA[c program]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1769</guid>

					<description><![CDATA[<p>Here is the program to arrange the string in alphabetical order. #include "stdio.h" #include "conio.h" #include "string.h" void main() { char str[10],temp; int i,j; clrscr(); printf("\nEnter the string : "); scanf("%s",str); for(i=0;i&#60;strlen(str);i++) for(j=0;j&#60;strlen(str);j++) if(str[i]&#60;str[j]) { temp = str[i]; str[i] = str[j]; str[j] = temp; } printf(&#34;Reversed String is : %s&#34;,str); getch(); }</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/program-arrange-string-alphabetical-order/">Program to arrange the string in alphabetical order</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Here is the program to arrange the string in alphabetical order.</p>
<pre lang="c" escaped="true" line="1">
  #include "stdio.h"
  #include "conio.h"
  #include "string.h"
  void main()
  {
     char str[10],temp;
     int i,j;
     clrscr();
     printf("\nEnter the string : ");
     scanf("%s",str);
     for(i=0;i&lt;strlen(str);i++)
       for(j=0;j&lt;strlen(str);j++)
	 if(str[i]&lt;str[j])
	 {
	   temp = str[i];
	   str[i] = str[j];
	   str[j] = temp;
	 }
     printf(&quot;Reversed String is : %s&quot;,str);
     getch();
  }
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/program-arrange-string-alphabetical-order/">Program to arrange the string in alphabetical order</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-arrange-string-alphabetical-order/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Program to delete n Characters from a given position in a given string using functions</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/string/program-delete-characters-position-string-functions/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/string/program-delete-characters-position-string-functions/#comments</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Mon, 29 Aug 2011 09:39:37 +0000</pubDate>
				<category><![CDATA[String Programs]]></category>
		<category><![CDATA[delete characters]]></category>
		<category><![CDATA[string programs]]></category>
		<category><![CDATA[function]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1750</guid>

					<description><![CDATA[<p>This C program uses function delchar to delete n characters from a given position in a given string. #include "stdio.h" #include "conio.h" #include "string.h" void delchar(char *x,int a, int b); void main() { char string[10]; int n,pos,p; clrscr(); puts("Enter the string"); gets(string); printf("Enter the position from where to delete"); scanf("%d",&#38;pos); printf("Enter the number of characters</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/program-delete-characters-position-string-functions/">Program to delete n Characters from a given position in a given string using functions</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This C program uses function delchar to delete n characters from a given position in a given string.</p>
<pre lang="c" escaped="true" line="1">
#include "stdio.h"
#include "conio.h"
#include "string.h"

void delchar(char *x,int a, int b);

void main()
{
     char string[10];
     int n,pos,p;
     clrscr();

     puts("Enter the string");
     gets(string);
     printf("Enter the position from where to delete");
     scanf("%d",&amp;pos);
     printf("Enter the number of characters to be deleted");
     scanf("%d",&amp;n);
     delchar(string, n,pos);
     getch();
}

// Function to delete n characters
void delchar(char *x,int a, int b)
{
  if ((a+b-1) &lt;= strlen(x))
  {
    strcpy(&amp;x[b-1],&amp;x[a+b-1]);
    puts(x);
    }
}</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/string/program-delete-characters-position-string-functions/">Program to delete n Characters from a given position in a given string using functions</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-delete-characters-position-string-functions/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<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[C/C++]]></category>
		<category><![CDATA[C/C++ Programms]]></category>
		<category><![CDATA[Source Codes]]></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[C/C++]]></category>
		<category><![CDATA[C/C++ Programms]]></category>
		<category><![CDATA[Source Codes]]></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[C/C++]]></category>
		<category><![CDATA[C/C++ Programms]]></category>
		<category><![CDATA[Source Codes]]></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[C/C++]]></category>
		<category><![CDATA[C/C++ Programms]]></category>
		<category><![CDATA[Source Codes]]></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++]]></category>
		<category><![CDATA[C/C++ Programms]]></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>
	</channel>
</rss>
