<?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>Cheap-Computers-HowTo.com &#187; graemew</title>
	<atom:link href="http://www.cheap-computers-howto.com/author/graemew/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cheap-computers-howto.com</link>
	<description>A collection of ICT tips, howtos and tutes.</description>
	<lastBuildDate>Sat, 09 Apr 2011 12:31:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>The string class in C++</title>
		<link>http://www.cheap-computers-howto.com/the-string-class-in-c/</link>
		<comments>http://www.cheap-computers-howto.com/the-string-class-in-c/#comments</comments>
		<pubDate>Tue, 26 May 2009 21:20:49 +0000</pubDate>
		<dc:creator>graemew</dc:creator>
				<category><![CDATA[Working with C++]]></category>

		<guid isPermaLink="false">http://www.cheap-computers-howto.com/?p=11</guid>
		<description><![CDATA[In C++ a string is implemented as an instance of the string class. Inorder to use the functions of this class, the following include statement must be part of your program code: #include &#60;string&#62; As the string class is a member of the namespace  std , an instance of this class is declared with the [...]]]></description>
			<content:encoded><![CDATA[<p>In C++ a string is implemented as an instance of the <strong>string</strong> class. Inorder to use the functions of this class, the following include statement must be part of your program code:</p>
<p style="padding-left: 30px;"><strong>#include &lt;string&gt;</strong></p>
<p>As the string class is a member of the namespace  std , an instance of this class is declared with the following syntax:</p>
<p style="padding-left: 30px;"><strong>std::string    messageStr;</strong> // declares a string called  messageStr</p>
<p>Remember, the std:: syntax can be omitted, provided you include  the following statement  in your code:</p>
<p><strong>using namespace std;</strong></p>
<p style="padding-left: 30px;">The members of the string class are:</p>
<p><strong>Parameters:</strong></p>
<p><strong>str</strong> a string    [(data type: string]</p>
<p><strong>pos</strong> a (character) position in the string [ data type:  type_t ]</p>
<p><strong>no</strong> the number of characters selected  [ data type: type_t ]</p>
<p><strong>Commonly used methods in the string class, include:</strong></p>
<p>length()        returns the number of characters in the stored string</p>
<p>capacity()   returns the capacity of the string; this is greater than or equal to the length of the string</p>
<p>[i]                   returns the ith character of the string</p>
<p>insert( pos, str )       inserts the string st, starting at the position pos in the string</p>
<p>remove( pos, no )      starting at position pos in the string, removes the number of characters  no</p>
<p>get_at( pos )                returns the character at position pos in the string</p>
<p>put_at( pos, char )    replaces the character at position pos, with the character char</p>
<p>replace( pos, no, str )    starting at position pos, replaces number of characters no, with the string str</p>
<p>+                  returns the concatenation of two strings,  eg    john + smith   would be  johnsmith</p>
<p>substr( pos, no )      returns a new string that begins with the character at position pos in the original string, and has length  no  (remember:     no  =  number of characters)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cheap-computers-howto.com/the-string-class-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

