<?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</title>
	<atom:link href="http://www.cheap-computers-howto.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cheap-computers-howto.com</link>
	<description>A collection of ICT tips, howtos and tutes. Enjoy!</description>
	<lastBuildDate>Wed, 22 Jul 2009 20:06:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The string class in C++</title>
		<link>http://www.cheap-computers-howto.com/2009/05/the-string-class-in-c/</link>
		<comments>http://www.cheap-computers-howto.com/2009/05/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 following syntax:
std::string    [...]]]></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/2009/05/the-string-class-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strings in C++</title>
		<link>http://www.cheap-computers-howto.com/2009/05/strings-in-c/</link>
		<comments>http://www.cheap-computers-howto.com/2009/05/strings-in-c/#comments</comments>
		<pubDate>Tue, 26 May 2009 20:38:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Working with C++]]></category>

		<guid isPermaLink="false">http://www.cheap-computers-howto.com/?p=9</guid>
		<description><![CDATA[Strings and Arrays of characters in C++
Low level strings are represented by arrays of characters in C and C++. These arrays are terminated by &#8216;\0&#8242; , the special marker character null, which is used to indicate the end of a string.
char string1[ ] = { &#8216;H&#8217;,'e&#8217;,'l&#8217;,'l&#8217;,'o&#8217;,&#8217; &#8216;, &#8216;W&#8217;, &#8216;o&#8217;, &#8216;r&#8217;, &#8216;l&#8217;, &#8216;d&#8217;, &#8216;\0&#8242; }
The following [...]]]></description>
			<content:encoded><![CDATA[<h2>Strings and Arrays of characters in C++</h2>
<p>Low level strings are represented by arrays of characters in C and C++. These arrays are terminated by &#8216;\0&#8242; , the special marker character <strong>null</strong>, which is used to indicate the end of a string.</p>
<p style="padding-left: 30px;">char string1[ ] = { &#8216;H&#8217;,'e&#8217;,'l&#8217;,'l&#8217;,'o&#8217;,&#8217; &#8216;, &#8216;W&#8217;, &#8216;o&#8217;, &#8216;r&#8217;, &#8216;l&#8217;, &#8216;d&#8217;, &#8216;\0&#8242; }</p>
<p>The following short program could be used to display string1 :</p>
<p>#include &lt;iostream&gt;</p>
<p>using namespace std;</p>
<p>int main() {</p>
<p style="padding-left: 30px;">char string1[ ] =  { &#8216;H&#8217;,'e&#8217;,'l&#8217;,'l&#8217;,'o&#8217;,&#8217; &#8216;, &#8216;W&#8217;, &#8216;o&#8217;, &#8216;r&#8217;, &#8216;l&#8217;, &#8216;d&#8217;, &#8216;\0&#8242; } ;</p>
<p style="padding-left: 30px;">cout &lt;&lt; string1 &lt;&lt; endl ;</p>
<p style="padding-left: 30px;">return 0;</p>
<p>}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cheap-computers-howto.com/2009/05/strings-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Enumerations in C++</title>
		<link>http://www.cheap-computers-howto.com/2009/05/hello-world/</link>
		<comments>http://www.cheap-computers-howto.com/2009/05/hello-world/#comments</comments>
		<pubDate>Sun, 24 May 2009 20:41:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Working with C++]]></category>

		<guid isPermaLink="false">http://www.cheap-computers-howto.com/?p=1</guid>
		<description><![CDATA[Enumerations in C++ work in a similar manner to other languages, to restrict a particular variable to having a specific set of values.
For example:
enum Names {Fred, Mary, John, Anne}
In this case, a  new type is created, which may have &#60;b&#62;only&#60;/b&#62; the values Fred, Mary, John, Anne.
The compiler will represent Fred as 0, Mary as 1  [...]]]></description>
			<content:encoded><![CDATA[<p>Enumerations in C++ work in a similar manner to other languages, to restrict a particular variable to having a specific set of values.</p>
<p>For example:</p>
<p><strong>enum Names {Fred, Mary, John, Anne}</strong></p>
<p>In this case, a  new type is created, which may have &lt;b&gt;only&lt;/b&gt; the values <strong>Fred</strong>, <strong>Mary</strong>, <strong>John</strong>, <strong>Anne</strong>.</p>
<p>The compiler will represent Fred as 0, Mary as 1  and so on. John will take the next value, which here will be 2.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cheap-computers-howto.com/2009/05/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
