<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for 2,000 Things You Should Know About C#</title>
	<atom:link href="http://csharp.2000things.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://csharp.2000things.com</link>
	<description>Everything a C# Developer Needs to Know, in Bite-Sized Chunks</description>
	<lastBuildDate>Wed, 22 Feb 2012 18:08:47 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>Comment on #410 &#8211; Overloading the == Operator for a Value Type by inez</title>
		<link>http://csharp.2000things.com/2011/09/13/410-overloading-the-operator-for-a-value-type/#comment-848</link>
		<dc:creator><![CDATA[inez]]></dc:creator>
		<pubDate>Wed, 22 Feb 2012 18:08:47 +0000</pubDate>
		<guid isPermaLink="false">http://csharp.2000things.com/?p=3469#comment-848</guid>
		<description><![CDATA[I write it but rewrote it and it finally started working...nice site]]></description>
		<content:encoded><![CDATA[<p>I write it but rewrote it and it finally started working&#8230;nice site</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on #410 &#8211; Overloading the == Operator for a Value Type by Sean</title>
		<link>http://csharp.2000things.com/2011/09/13/410-overloading-the-operator-for-a-value-type/#comment-846</link>
		<dc:creator><![CDATA[Sean]]></dc:creator>
		<pubDate>Mon, 20 Feb 2012 19:27:50 +0000</pubDate>
		<guid isPermaLink="false">http://csharp.2000things.com/?p=3469#comment-846</guid>
		<description><![CDATA[Did you write this code yourself, or just copy it from somewhere?  How are you trying to compile it?  It looks like C++ code, so if you&#039;re trying to use a C# compiler to compile it, you&#039;ll certainly get a lot of errors. :O)]]></description>
		<content:encoded><![CDATA[<p>Did you write this code yourself, or just copy it from somewhere?  How are you trying to compile it?  It looks like C++ code, so if you&#8217;re trying to use a C# compiler to compile it, you&#8217;ll certainly get a lot of errors. :O)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on #410 &#8211; Overloading the == Operator for a Value Type by inez</title>
		<link>http://csharp.2000things.com/2011/09/13/410-overloading-the-operator-for-a-value-type/#comment-845</link>
		<dc:creator><![CDATA[inez]]></dc:creator>
		<pubDate>Mon, 20 Feb 2012 16:10:42 +0000</pubDate>
		<guid isPermaLink="false">http://csharp.2000things.com/?p=3469#comment-845</guid>
		<description><![CDATA[can you help? I am receiving LOTs of errors....



#include 
#include 
#include 

using namespace std;



struct electionList
{
    void print() const;
	void voteTotal();
	void solvePercentage();
	void calcWinner();
    int votes[100];
	double percentage[100];
    string candidates[2];
    int count;
	int total;
    
};



//CALCULATES TOTAL AMOUNT OF VOTES FOR EACH CANDIDATE     
void electionList::print() const
{    
    cout&lt;&lt;&quot;Candidate&quot;&lt;&lt;&quot;Votes Received&quot;&lt;&lt;&quot;% of Votes&quot;&lt;&lt;endl;
    
    for (int i=0; i&lt;count; i++)
    {
        cout&lt;&lt;candidates[i];
        cout&lt;&lt;votes[i];
        cout&lt;&lt; percentage[i];
    }
    
    cout&lt;&lt;&quot;Total&quot;&lt;&lt;total&lt;&lt;endl;
}


void electionList::voteTotal()
{
    int total;
    for (int i=0; i&lt;count; i++)
    {
        total = total + votes[i];
    }
}

//CALCULATES PERCENTAGE OF VOTES FOR EACH CANDIDATE

void electionList::solvePercentage()

{
    for (int i=0; i&lt;count; i++)
    {
        percentage[i] = ((votes[i]/total)*(100));
    }
}


//cOMPARES NUMBER OF VOTES FOR WINNER

void electionList::calcWinner()
{
    string winner = candidates[0];
    int max = votes[0];
    
    for (int i=0; imax)
        {
            max = votes[i];
            winner = candidates[i];
        }
    }
    
};


int main()
{
    
    electionList election; 
    electionList insert();
    
    string name; 
    int count;
    
    int tally;
    string candidate[100];
    int votes[100];
    
       
    
    //INPUT DATA
    
    cout&lt;&gt; count;
    
    for (int i=0; i&lt;count; i++)
        
    {
        cout&lt;&gt;name&gt;&gt;tally;
        candidate[i]=name;
        votes[i]=tally;
        //candidate-&gt;insert(i,name)&gt;&gt;votes-&gt;insert(i, votes);
        
    }
    count = 1;
    candidate[1]=&quot;thomas&quot;;
    votes[1] = 300;
    
    cout&lt;&lt;candidate[1]&lt;&lt;votes[1];
    // OUTPUT RESULTS
    cout&lt;&lt;&quot;election result&quot;;
    election.print();
    cout&lt;&lt;&quot;election vote total&quot;;
    election.voteTotal();};]]></description>
		<content:encoded><![CDATA[<p>can you help? I am receiving LOTs of errors&#8230;.</p>
<p>#include<br />
#include<br />
#include </p>
<p>using namespace std;</p>
<p>struct electionList<br />
{<br />
    void print() const;<br />
	void voteTotal();<br />
	void solvePercentage();<br />
	void calcWinner();<br />
    int votes[100];<br />
	double percentage[100];<br />
    string candidates[2];<br />
    int count;<br />
	int total;</p>
<p>};</p>
<p>//CALCULATES TOTAL AMOUNT OF VOTES FOR EACH CANDIDATE<br />
void electionList::print() const<br />
{<br />
    cout&lt;&lt;&quot;Candidate&quot;&lt;&lt;&quot;Votes Received&quot;&lt;&lt;&quot;% of Votes&quot;&lt;&lt;endl;</p>
<p>    for (int i=0; i&lt;count; i++)<br />
    {<br />
        cout&lt;&lt;candidates[i];<br />
        cout&lt;&lt;votes[i];<br />
        cout&lt;&lt; percentage[i];<br />
    }</p>
<p>    cout&lt;&lt;&quot;Total&quot;&lt;&lt;total&lt;&lt;endl;<br />
}</p>
<p>void electionList::voteTotal()<br />
{<br />
    int total;<br />
    for (int i=0; i&lt;count; i++)<br />
    {<br />
        total = total + votes[i];<br />
    }<br />
}</p>
<p>//CALCULATES PERCENTAGE OF VOTES FOR EACH CANDIDATE</p>
<p>void electionList::solvePercentage()</p>
<p>{<br />
    for (int i=0; i&lt;count; i++)<br />
    {<br />
        percentage[i] = ((votes[i]/total)*(100));<br />
    }<br />
}</p>
<p>//cOMPARES NUMBER OF VOTES FOR WINNER</p>
<p>void electionList::calcWinner()<br />
{<br />
    string winner = candidates[0];<br />
    int max = votes[0];</p>
<p>    for (int i=0; imax)<br />
        {<br />
            max = votes[i];<br />
            winner = candidates[i];<br />
        }<br />
    }</p>
<p>};</p>
<p>int main()<br />
{</p>
<p>    electionList election;<br />
    electionList insert();</p>
<p>    string name;<br />
    int count;</p>
<p>    int tally;<br />
    string candidate[100];<br />
    int votes[100];</p>
<p>    //INPUT DATA</p>
<p>    cout&lt;&gt; count;</p>
<p>    for (int i=0; i&lt;count; i++)</p>
<p>    {<br />
        cout&lt;&gt;name&gt;&gt;tally;<br />
        candidate[i]=name;<br />
        votes[i]=tally;<br />
        //candidate-&gt;insert(i,name)&gt;&gt;votes-&gt;insert(i, votes);</p>
<p>    }<br />
    count = 1;<br />
    candidate[1]=&#8221;thomas&#8221;;<br />
    votes[1] = 300;</p>
<p>    cout&lt;&lt;candidate[1]&lt;&lt;votes[1];<br />
    // OUTPUT RESULTS<br />
    cout&lt;&lt;&quot;election result&quot;;<br />
    election.print();<br />
    cout&lt;&lt;&quot;election vote total&quot;;<br />
    election.voteTotal();};</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on #522 &#8211; The Fully Qualified Name for a Type Includes the Namespace by #523 &#8211; The using Directive Allows Omitting Namespace &#171; 2,000 Things You Should Know About C#</title>
		<link>http://csharp.2000things.com/2012/02/17/522-the-fully-qualified-name-for-a-type-includes-the-namespace/#comment-844</link>
		<dc:creator><![CDATA[#523 &#8211; The using Directive Allows Omitting Namespace &#171; 2,000 Things You Should Know About C#]]></dc:creator>
		<pubDate>Mon, 20 Feb 2012 11:01:21 +0000</pubDate>
		<guid isPermaLink="false">http://csharp.2000things.com/?p=4405#comment-844</guid>
		<description><![CDATA[[...] Operators          &#8592; #522 &#8211; The Fully Qualified Name for a Type Includes the&#160;Namespace [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Operators          &larr; #522 &#8211; The Fully Qualified Name for a Type Includes the&nbsp;Namespace [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on #521 &#8211; Namespaces Help Organize Types by #523 &#8211; The using Directive Allows Omitting Namespace &#171; 2,000 Things You Should Know About C#</title>
		<link>http://csharp.2000things.com/2012/02/16/521-namespaces-help-organize-types/#comment-843</link>
		<dc:creator><![CDATA[#523 &#8211; The using Directive Allows Omitting Namespace &#171; 2,000 Things You Should Know About C#]]></dc:creator>
		<pubDate>Mon, 20 Feb 2012 11:01:19 +0000</pubDate>
		<guid isPermaLink="false">http://csharp.2000things.com/?p=4393#comment-843</guid>
		<description><![CDATA[[...] typical C# program will use types that are defined in a variety of namespaces.  Specifying the fully qualified type name that includes the namespace can become [...]]]></description>
		<content:encoded><![CDATA[<p>[...] typical C# program will use types that are defined in a variety of namespaces.  Specifying the fully qualified type name that includes the namespace can become [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on #521 &#8211; Namespaces Help Organize Types by #522 &#8211; The Fully Qualified Name for a Type Includes the Namespace &#171; 2,000 Things You Should Know About C#</title>
		<link>http://csharp.2000things.com/2012/02/16/521-namespaces-help-organize-types/#comment-842</link>
		<dc:creator><![CDATA[#522 &#8211; The Fully Qualified Name for a Type Includes the Namespace &#171; 2,000 Things You Should Know About C#]]></dc:creator>
		<pubDate>Mon, 20 Feb 2012 11:01:15 +0000</pubDate>
		<guid isPermaLink="false">http://csharp.2000things.com/?p=4393#comment-842</guid>
		<description><![CDATA[[...]          &#8592; #521 &#8211; Namespaces Help Organize&#160;Types #523 &#8211; The using Directive Allows Omitting&#160;Namespace [...]]]></description>
		<content:encoded><![CDATA[<p>[...]          &larr; #521 &#8211; Namespaces Help Organize&nbsp;Types #523 &#8211; The using Directive Allows Omitting&nbsp;Namespace [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on #520 &#8211; Choosing Between a struct and a Class by Sean</title>
		<link>http://csharp.2000things.com/2012/02/15/520-choosing-between-a-struct-and-a-class/#comment-835</link>
		<dc:creator><![CDATA[Sean]]></dc:creator>
		<pubDate>Thu, 16 Feb 2012 18:22:50 +0000</pubDate>
		<guid isPermaLink="false">http://csharp.2000things.com/?p=4387#comment-835</guid>
		<description><![CDATA[Yes, probably a good candidate for a struct, rather than class, especially since the class is meant to be immutable.]]></description>
		<content:encoded><![CDATA[<p>Yes, probably a good candidate for a struct, rather than class, especially since the class is meant to be immutable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on #520 &#8211; Choosing Between a struct and a Class by Pranav Shah</title>
		<link>http://csharp.2000things.com/2012/02/15/520-choosing-between-a-struct-and-a-class/#comment-834</link>
		<dc:creator><![CDATA[Pranav Shah]]></dc:creator>
		<pubDate>Thu, 16 Feb 2012 16:34:48 +0000</pubDate>
		<guid isPermaLink="false">http://csharp.2000things.com/?p=4387#comment-834</guid>
		<description><![CDATA[While reading this, I also came across &quot;Parameter Object&quot; refactoring.

Here is a class example:
 class DateRange {
    DateRange (Date start, Date end) {
        _start = start;
        _end = end;
    }
    Date getStart() {
        return _start;
    }
    Date getEnd() {
        return _end;
    }
    private final Date _start;
    private final Date _end;
	
	boolean includes (Date arg) {
        return (arg.equals(_start) &#124;&#124;
                arg.equals(_end) &#124;&#124;
                 (arg.after(_start) &amp;&amp; arg.before(_end)));
  }  

The code and the articles is from: http://sourcemaking.com/refactoring/introduce-parameter-object

I was wondering could this class be created as a Struct, and if that would be advantageous or not, with some explanation if possible.]]></description>
		<content:encoded><![CDATA[<p>While reading this, I also came across &#8220;Parameter Object&#8221; refactoring.</p>
<p>Here is a class example:<br />
 class DateRange {<br />
    DateRange (Date start, Date end) {<br />
        _start = start;<br />
        _end = end;<br />
    }<br />
    Date getStart() {<br />
        return _start;<br />
    }<br />
    Date getEnd() {<br />
        return _end;<br />
    }<br />
    private final Date _start;<br />
    private final Date _end;</p>
<p>	boolean includes (Date arg) {<br />
        return (arg.equals(_start) ||<br />
                arg.equals(_end) ||<br />
                 (arg.after(_start) &amp;&amp; arg.before(_end)));<br />
  }  </p>
<p>The code and the articles is from: <a href="http://sourcemaking.com/refactoring/introduce-parameter-object" rel="nofollow">http://sourcemaking.com/refactoring/introduce-parameter-object</a></p>
<p>I was wondering could this class be created as a Struct, and if that would be advantageous or not, with some explanation if possible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on #226 &#8211; Classes and Objects by #519 &#8211; Differences Between structs and classes &#171; 2,000 Things You Should Know About C#</title>
		<link>http://csharp.2000things.com/2011/01/29/226-classes-and-objects/#comment-832</link>
		<dc:creator><![CDATA[#519 &#8211; Differences Between structs and classes &#171; 2,000 Things You Should Know About C#]]></dc:creator>
		<pubDate>Tue, 14 Feb 2012 11:00:55 +0000</pubDate>
		<guid isPermaLink="false">http://csharp.2000things.com/?p=2027#comment-832</guid>
		<description><![CDATA[[...] are a number of differences between a struct and a class, [...]]]></description>
		<content:encoded><![CDATA[<p>[...] are a number of differences between a struct and a class, [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on #107 &#8211; Defining and Using a Struct by #519 &#8211; Differences Between structs and classes &#171; 2,000 Things You Should Know About C#</title>
		<link>http://csharp.2000things.com/2010/10/02/107-defining-and-using-a-struct/#comment-831</link>
		<dc:creator><![CDATA[#519 &#8211; Differences Between structs and classes &#171; 2,000 Things You Should Know About C#]]></dc:creator>
		<pubDate>Tue, 14 Feb 2012 11:00:52 +0000</pubDate>
		<guid isPermaLink="false">http://csharp.2000things.com/?p=1072#comment-831</guid>
		<description><![CDATA[[...] are a number of differences between a struct and a class, [...]]]></description>
		<content:encoded><![CDATA[<p>[...] are a number of differences between a struct and a class, [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
