<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
	<title>Comments for Learn C++</title>
	
	<link>http://www.learncpp.com</link>
	<description />
	<lastBuildDate>Wed, 08 May 2013 20:23:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/LearnCppComments" /><feedburner:info uri="learncppcomments" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><item>
		<title>Comment on 4.7 — Structs by Blackout</title>
		<link>http://www.learncpp.com/cpp-tutorial/47-structs/comment-page-2/#comment-98764</link>
		<dc:creator>Blackout</dc:creator>
		<pubDate>Wed, 08 May 2013 20:23:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/47-structs/#comment-98764</guid>
		<description>[code]
#include&lt;iostream&gt;

int main()
{
    using namespace std;
    cout&lt;&lt;"Enter how many ads were generated:"&lt;&lt;endl;
    int x;
    cin&gt;&gt;x;
    cout&lt;&lt;"Enter the percentage of the people who clicked on the ads(in decimal form):"&lt;&lt;endl;
    float  y;
    cin&gt;&gt;y;
    cout&lt;&lt;"Enter the average amount of money generated by each click:"&lt;&lt;endl;
    float z;
    cin&gt;&gt;z;

    int NumberOfAds= x;
    float PercentageOfClicks=y;
    float AverageAmountOfMoney=z;

    cout&lt;&lt; "The Amount of Money You Made Is: "&lt;&lt;"$" &lt;&lt;NumberOfAds*PercentageOfClicks*AverageAmountOfMoney&lt;&lt;endl;
    return 0;
}
[/code]
This is what I did, I didn't use structs because I wasn't sure how, but it works.</description>
		<content:encoded><![CDATA[<pre class="brush: plain; title: ; notranslate">
#include&lt;iostream&gt;

int main()
{
    using namespace std;
    cout&lt;&lt;&quot;Enter how many ads were generated:&quot;&lt;&lt;endl;
    int x;
    cin&gt;&gt;x;
    cout&lt;&lt;&quot;Enter the percentage of the people who clicked on the ads(in decimal form):&quot;&lt;&lt;endl;
    float  y;
    cin&gt;&gt;y;
    cout&lt;&lt;&quot;Enter the average amount of money generated by each click:&quot;&lt;&lt;endl;
    float z;
    cin&gt;&gt;z;

    int NumberOfAds= x;
    float PercentageOfClicks=y;
    float AverageAmountOfMoney=z;

    cout&lt;&lt; &quot;The Amount of Money You Made Is: &quot;&lt;&lt;&quot;$&quot; &lt;&lt;NumberOfAds*PercentageOfClicks*AverageAmountOfMoney&lt;&lt;endl;
    return 0;
}
</pre>
<p>This is what I did, I didn&#8217;t use structs because I wasn&#8217;t sure how, but it works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 6.11 — References by stupi</title>
		<link>http://www.learncpp.com/cpp-tutorial/611-references/comment-page-1/#comment-98734</link>
		<dc:creator>stupi</dc:creator>
		<pubDate>Mon, 06 May 2013 00:19:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-programming/611-references-2/#comment-98734</guid>
		<description>Alex, is this?
&lt;code&gt;int nValue = 5;
const int &amp;rnRef = nValue;

rnRef=7;&lt;!--formatted--&gt;&lt;/code&gt;
the complier was wrong, that means we can't change the value of conts reference.</description>
		<content:encoded><![CDATA[<p>Alex, is this?<br />
<code>int nValue = 5;<br />
const int &amp;rnRef = nValue;</p>
<p>rnRef=7;<!--formatted--></code><br />
the complier was wrong, that means we can&#8217;t change the value of conts reference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 2.10 — Comprehensive quiz by Code_Blackout</title>
		<link>http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/comment-page-2/#comment-98684</link>
		<dc:creator>Code_Blackout</dc:creator>
		<pubDate>Fri, 03 May 2013 16:59:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/#comment-98684</guid>
		<description>Is this site still alive? I emailed "Alex" with a question but I haven't received an answer...</description>
		<content:encoded><![CDATA[<p>Is this site still alive? I emailed &#8220;Alex&#8221; with a question but I haven&#8217;t received an answer&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 2.10 — Comprehensive quiz by Coder_Blackout</title>
		<link>http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/comment-page-2/#comment-98659</link>
		<dc:creator>Coder_Blackout</dc:creator>
		<pubDate>Thu, 02 May 2013 23:04:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/#comment-98659</guid>
		<description>This is my code that I used, and I only looked at the solution 'cause I forgot that in if statements you need '' around +, -, /, *.
[code]#include&lt;iostream&gt;
#include&lt;string&gt;



int main()
{
    using namespace std;
   cout&lt;&lt;"Enter a number:";
double long x;
cin&gt;&gt; x;


cout&lt;&lt;"Enter one of these: (*, /, +, -)";
char chOperator;
cin&gt;&gt;chOperator;

cout&lt;&lt;"Enter another number:";
double long y;
cin&gt;&gt; y;
if (chOperator== '*' )
        cout&lt;&lt;x*y;
    if(chOperator=='+')
            cout&lt;&lt;x+y;
        if (chOperator=='-')
                cout&lt;&lt;x-y;
            if(chOperator=='/')
                    cout&lt;&lt;x/y;
return 0;



}
[/code]</description>
		<content:encoded><![CDATA[<p>This is my code that I used, and I only looked at the solution &#8217;cause I forgot that in if statements you need &#8221; around +, -, /, *.</p>
<pre class="brush: plain; title: ; notranslate">#include&lt;iostream&gt;
#include&lt;string&gt;

int main()
{
    using namespace std;
   cout&lt;&lt;&quot;Enter a number:&quot;;
double long x;
cin&gt;&gt; x;

cout&lt;&lt;&quot;Enter one of these: (*, /, +, -)&quot;;
char chOperator;
cin&gt;&gt;chOperator;

cout&lt;&lt;&quot;Enter another number:&quot;;
double long y;
cin&gt;&gt; y;
if (chOperator== '*' )
        cout&lt;&lt;x*y;
    if(chOperator=='+')
            cout&lt;&lt;x+y;
        if (chOperator=='-')
                cout&lt;&lt;x-y;
            if(chOperator=='/')
                    cout&lt;&lt;x/y;
return 0;

}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on B.6 — New virtual function controls: override, final, default, and delete by Anvi</title>
		<link>http://www.learncpp.com/cpp-tutorial/b-6-new-virtual-function-controls-override-final-default-and-delete/comment-page-1/#comment-98652</link>
		<dc:creator>Anvi</dc:creator>
		<pubDate>Thu, 02 May 2013 10:03:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=695#comment-98652</guid>
		<description>Im soo thankful to you.. its soo much fun to learn this way , amazing stuff..
Thank u sooo much</description>
		<content:encoded><![CDATA[<p>Im soo thankful to you.. its soo much fun to learn this way , amazing stuff..<br />
Thank u sooo much</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 8.9 — Class code and header files by Marvin</title>
		<link>http://www.learncpp.com/cpp-tutorial/89-class-code-and-header-files/comment-page-1/#comment-98638</link>
		<dc:creator>Marvin</dc:creator>
		<pubDate>Wed, 01 May 2013 13:41:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/89-class-code-and-header-files/#comment-98638</guid>
		<description>Hello, 
I have created a child class and parent class in header files, these are the code:
Child Class:

#ifndef PERRO_H_
#define PERRO_H_
#include "Mamifero.h"


class Perro : public Mamifero {
public:
	Perro():raza(COLLEN){}
	~Perro();

     RAZA getRaza() const {return raza;};
     void setRaza(RAZA _raza) {raza = _raza;};

     void moverCola() const {cout&lt;&lt;"Cola meneandola..."&lt;&lt;endl;}
     void pedirComida() const {cout&lt;&lt;"Pidiendo Comida..."&lt;&lt;endl;}


protected:
     RAZA raza;

};
#endif /* PERRO_H_ */


And the parent class:

#ifndef MAMIFERO_H_
using namespace std;

enum RAZA {COLLEN, CALEN , DANDIE, SERTLAN, DOBERMAN, LAB};

class Mamifero {
public:
	Mamifero(): age(2), weight(5) {}
	~Mamifero(){};
	int getAge() const {return age;}
	int getWeight() const {return weight;}
	void setWeight(int _weight) {weight = _weight;}
	void setAge(int _age) {age = _age;}

	void hablar() const {cout&lt;&lt;"Sonido Mamimero"&lt;&lt;endl;};
	void dormir() const {cout&lt;&lt;"shhh... esta durmiendo"&lt;&lt;endl;};

protected:
	int age;
	int weight;
};
#endif /* MAMIFERO_H_ */

and this i what i want to get from the main:

#include 
#include "Mamifero.h"
#include "Perro.h"

using namespace std;



int main() {
    Perro model;
    model.hablar();
    model.moverCola();
    cout&lt;&lt;"Model tiene "&lt;&lt;model.getAge() &lt;&lt;" anhos de edad"&lt;&lt;endl;


	return 0;
}

But i do not know what is happening with the enum data type because i recieve
this logs in the console:

..\src\/Mamifero.h:11:6: error: multiple definition of 'enum RAZA'
..\src\/Mamifero.h:11:6: error: previous definition here
..\src\/Mamifero.h:13:7: error: redefinition of 'class Mamifero'
..\src\/Mamifero.h:13:7: error: previous definition of 'class Mamifero'

I can not get the reason why the enum is duplicated or something similar.

Could you please help with this.
Thanks</description>
		<content:encoded><![CDATA[<p>Hello,<br />
I have created a child class and parent class in header files, these are the code:<br />
Child Class:</p>
<p>#ifndef PERRO_H_<br />
#define PERRO_H_<br />
#include &#8220;Mamifero.h&#8221;</p>
<p>class Perro : public Mamifero {<br />
public:<br />
	Perro():raza(COLLEN){}<br />
	~Perro();</p>
<p>     RAZA getRaza() const {return raza;};<br />
     void setRaza(RAZA _raza) {raza = _raza;};</p>
<p>     void moverCola() const {cout&lt;&lt;&quot;Cola meneandola&#8230;&quot;&lt;&lt;endl;}<br />
     void pedirComida() const {cout&lt;&lt;&quot;Pidiendo Comida&#8230;&quot;&lt;&lt;endl;}</p>
<p>protected:<br />
     RAZA raza;</p>
<p>};<br />
#endif /* PERRO_H_ */</p>
<p>And the parent class:</p>
<p>#ifndef MAMIFERO_H_<br />
using namespace std;</p>
<p>enum RAZA {COLLEN, CALEN , DANDIE, SERTLAN, DOBERMAN, LAB};</p>
<p>class Mamifero {<br />
public:<br />
	Mamifero(): age(2), weight(5) {}<br />
	~Mamifero(){};<br />
	int getAge() const {return age;}<br />
	int getWeight() const {return weight;}<br />
	void setWeight(int _weight) {weight = _weight;}<br />
	void setAge(int _age) {age = _age;}</p>
<p>	void hablar() const {cout&lt;&lt;&quot;Sonido Mamimero&quot;&lt;&lt;endl;};<br />
	void dormir() const {cout&lt;&lt;&quot;shhh&#8230; esta durmiendo&quot;&lt;&lt;endl;};</p>
<p>protected:<br />
	int age;<br />
	int weight;<br />
};<br />
#endif /* MAMIFERO_H_ */</p>
<p>and this i what i want to get from the main:</p>
<p>#include<br />
#include &#8220;Mamifero.h&#8221;<br />
#include &#8220;Perro.h&#8221;</p>
<p>using namespace std;</p>
<p>int main() {<br />
    Perro model;<br />
    model.hablar();<br />
    model.moverCola();<br />
    cout&lt;&lt;&quot;Model tiene &quot;&lt;&lt;model.getAge() &lt;&lt;&quot; anhos de edad&quot;&lt;&lt;endl;</p>
<p>	return 0;<br />
}</p>
<p>But i do not know what is happening with the enum data type because i recieve<br />
this logs in the console:</p>
<p>..\src\/Mamifero.h:11:6: error: multiple definition of &#039;enum RAZA&#039;<br />
..\src\/Mamifero.h:11:6: error: previous definition here<br />
..\src\/Mamifero.h:13:7: error: redefinition of &#039;class Mamifero&#039;<br />
..\src\/Mamifero.h:13:7: error: previous definition of &#039;class Mamifero&#039;</p>
<p>I can not get the reason why the enum is duplicated or something similar.</p>
<p>Could you please help with this.<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 5.3 — Switch statements by sush tiwari</title>
		<link>http://www.learncpp.com/cpp-tutorial/53-switch-statements/comment-page-1/#comment-98632</link>
		<dc:creator>sush tiwari</dc:creator>
		<pubDate>Wed, 01 May 2013 05:54:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/53-switch/#comment-98632</guid>
		<description>I Love this tutorial!!!!!!!!!! Alex u did a great JOB!!!!!!!!!

which one is faster switch or if else? why?</description>
		<content:encoded><![CDATA[<p>I Love this tutorial!!!!!!!!!! Alex u did a great JOB!!!!!!!!!</p>
<p>which one is faster switch or if else? why?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 9.2 — Overloading the arithmetic operators by Over loading * operator - must take either zero or one arguments | BlogoSfera</title>
		<link>http://www.learncpp.com/cpp-tutorial/92-overloading-the-arithmetic-operators/comment-page-1/#comment-98627</link>
		<dc:creator>Over loading * operator - must take either zero or one arguments | BlogoSfera</dc:creator>
		<pubDate>Tue, 30 Apr 2013 17:48:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/92-overloading-the-arithmetic-operators/#comment-98627</guid>
		<description>[...] new to overloading operators, I did some search and found this helpful article, I wrote my own code like the author did but I get vector vector::operator*(float, vector) must [...]</description>
		<content:encoded><![CDATA[<p>[...] new to overloading operators, I did some search and found this helpful article, I wrote my own code like the author did but I get vector vector::operator*(float, vector) must [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 9.12 — Shallow vs. deep copying by shallow copy vs deep copy | POURLAWINE</title>
		<link>http://www.learncpp.com/cpp-tutorial/912-shallow-vs-deep-copying/comment-page-1/#comment-98625</link>
		<dc:creator>shallow copy vs deep copy | POURLAWINE</dc:creator>
		<pubDate>Tue, 30 Apr 2013 12:25:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/912-shallow-vs-deep-copying/#comment-98625</guid>
		<description>[...] http://www.learncpp.com/cpp-tutorial/912-shallow-vs-deep-copying/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.learncpp.com/cpp-tutorial/912-shallow-vs-deep-copying/" rel="nofollow">http://www.learncpp.com/cpp-tutorial/912-shallow-vs-deep-copying/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The C++ Tutorial by whats a good programing language to start with? - Tech &amp; Computer Forums</title>
		<link>http://www.learncpp.com/comment-page-1/#comment-98621</link>
		<dc:creator>whats a good programing language to start with? - Tech &amp; Computer Forums</dc:creator>
		<pubDate>Tue, 30 Apr 2013 03:04:42 +0000</pubDate>
		<guid isPermaLink="false">http://learncpp.com/?page_id=3#comment-98621</guid>
		<description>[...] a good programing language to start with?    How To Learn The Basics Of C++ Part 1/5 - C++ Articles Learn C++   __________________ "As a result of all this hardship, dirt, thirst, and wombats, you would [...]</description>
		<content:encoded><![CDATA[<p>[...] a good programing language to start with?    How To Learn The Basics Of C++ Part 1/5 &#8211; C++ Articles Learn C++   __________________ &quot;As a result of all this hardship, dirt, thirst, and wombats, you would [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss><!-- Dynamic page generated in 0.411 seconds. --><!-- Cached page generated by WP-Super-Cache on 2013-05-08 13:09:07 --><!-- Compression = gzip -->
