<?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>strings in c++ | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/strings-in-c/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Thu, 29 Dec 2022 14:04:53 +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>Strings</title>
		<link>https://studentprojects.in/software-development/cpp/strings-2/</link>
					<comments>https://studentprojects.in/software-development/cpp/strings-2/#respond</comments>
		
		<dc:creator><![CDATA[Shubhajna Rai]]></dc:creator>
		<pubDate>Mon, 02 Jan 2023 02:19:00 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[strings in c++]]></category>
		<guid isPermaLink="false">https://studentprojects.in/?p=10066</guid>

					<description><![CDATA[<p>A string is a collection of characters. In contrast to C, we can construct a string variable rather than a character array to store a succession of characters. An array stores data of the same type. For example, integers can be kept in an integer array, and a set of characters can be saved in</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/strings-2/">Strings</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>A string is a collection of characters. In contrast to C, we can construct a string variable rather than a character array to store a succession of characters. An array stores data of the same type. For example, integers can be kept in an integer array, and a set of characters can be saved in a character array or a string variable. A string is a one-dimensional character array. Declaring a string is similar to declaring a one-dimensional array. It&#8217;s just that we&#8217;re thinking about it as a cast of characters. The syntax for declaring a string is shown below.</p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">string string_name ;</code></pre>



<p>In the preceding syntax, string name can be any name assigned to the string variable, and it can be given a string input later or even at the moment of definition.</p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">string string_name = "studentproject";</code></pre>



<p>Example of a string:</p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;
 
int main()
{
    // declare and initialise string
    string str = "studentproject";
    cout &lt;&lt; str &lt;&lt; endl;
    return 0;
}
</code></pre>



<p>Output:</p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">studentproject</code></pre><p>The post <a href="https://studentprojects.in/software-development/cpp/strings-2/">Strings</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/strings-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
