A<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://cppe.ru/index.php?action=history&amp;feed=atom&amp;title=C_Tutorial%2FString%2FString_Introduction</id>
		<title>C Tutorial/String/String Introduction - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://cppe.ru/index.php?action=history&amp;feed=atom&amp;title=C_Tutorial%2FString%2FString_Introduction"/>
		<link rel="alternate" type="text/html" href="http://cppe.ru/index.php?title=C_Tutorial/String/String_Introduction&amp;action=history"/>
		<updated>2026-04-10T15:53:37Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://cppe.ru/index.php?title=C_Tutorial/String/String_Introduction&amp;diff=3256&amp;oldid=prev</id>
		<title> в 14:21, 25 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://cppe.ru/index.php?title=C_Tutorial/String/String_Introduction&amp;diff=3256&amp;oldid=prev"/>
				<updated>2010-05-25T14:21:19Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 14:21, 25 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://cppe.ru/index.php?title=C_Tutorial/String/String_Introduction&amp;diff=3257&amp;oldid=prev</id>
		<title>Admin: 1 версия:&amp;#32;Импорт контента...</title>
		<link rel="alternate" type="text/html" href="http://cppe.ru/index.php?title=C_Tutorial/String/String_Introduction&amp;diff=3257&amp;oldid=prev"/>
				<updated>2010-05-25T10:32:05Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия: Импорт контента...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==A string is an array of characters.==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
int main(){&lt;br /&gt;
   char myname[] = &amp;quot;Dan&amp;quot;;&lt;br /&gt;
  &lt;br /&gt;
   printf(&amp;quot;%s \n&amp;quot;,myname);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Dan&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==String constants consist of text enclosed in double quotes==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;We must use the standard library function strcpy to copy the string constant into the variable.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;To initialize the variable name to Sam.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;string.h&amp;gt;    &lt;br /&gt;
    int main() &lt;br /&gt;
    {  &lt;br /&gt;
        char    name[4];   &lt;br /&gt;
        strcpy(name, &amp;quot;Sam&amp;quot;);&lt;br /&gt;
        return (0);    &lt;br /&gt;
    }&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;OL&amp;gt;&amp;lt;LI&amp;gt;A string is nothing more than a character array.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;All strings end with the NULL character.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;Use the %s placeholder in the printf() function to display string values.&amp;lt;/LI&amp;gt;&amp;lt;/OL&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
main ( )&lt;br /&gt;
{&lt;br /&gt;
    char *s1 = &amp;quot;abcd&amp;quot;;&lt;br /&gt;
    char s2[] = &amp;quot;efgh&amp;quot;;&lt;br /&gt;
    printf( &amp;quot;%s %16lu \n&amp;quot;, s1, s1);&lt;br /&gt;
    printf( &amp;quot;%s %16lu \n&amp;quot;, s2, s2);&lt;br /&gt;
    s1 = s2;&lt;br /&gt;
    printf( &amp;quot;%s %16lu \n&amp;quot;, s1, s1);&lt;br /&gt;
    printf( &amp;quot;%s %16lu \n&amp;quot;, s2, s2);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;abcd          4206592&lt;br /&gt;
efgh          2293584&lt;br /&gt;
efgh          2293584&lt;br /&gt;
efgh          2293584&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Strings always end with the NULL character==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;ASCII code for the NULL character is \0&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
int main(){&lt;br /&gt;
  char myname[4];&lt;br /&gt;
    myname[0] = &amp;quot;D&amp;quot;;&lt;br /&gt;
    myname[1] = &amp;quot;a&amp;quot;;&lt;br /&gt;
    myname[2] = &amp;quot;n&amp;quot;;&lt;br /&gt;
    myname[3] = &amp;quot;\0&amp;quot;;&lt;br /&gt;
    printf(&amp;quot;%s \n&amp;quot;,myname);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Dan&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Useful string function==&lt;br /&gt;
&lt;br /&gt;
Function&lt;br /&gt;
Description&lt;br /&gt;
strcpy(string1, string2)&lt;br /&gt;
Copy string2 into string1&lt;br /&gt;
strcat(string1, string2)&lt;br /&gt;
Concatenate string2 onto the end of string1&lt;br /&gt;
length = strlen(string)&lt;br /&gt;
Get the length of a string&lt;br /&gt;
strcmp(string1, string2)&lt;br /&gt;
0 if string1 equals string2, otherwise nonzero&lt;br /&gt;
&lt;br /&gt;
==Write string in a more traditional array style==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
int main(){&lt;br /&gt;
    char myname[] = { &amp;quot;D&amp;quot;, &amp;quot;a&amp;quot;, &amp;quot;n&amp;quot; };&lt;br /&gt;
    printf(&amp;quot;%s \n&amp;quot;,myname);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Dan?&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>