EOSERV Wiki > Page: Basic C plus plus guide > History > Revision Diff

Revision Diff: Basic C plus plus guide

Revision by at 19th Jun 2011 04:14 pm
DeletionsAdditions
* The == Sign
* The <nowiki>==</nowiki> Sign
The == Sign?
The <nowiki>==</nowiki> Sign?
== Is a basic sign which is very important. The == Checks a function which is being used alot. A small example of the " == "
<nowiki>==</nowiki> Is a basic sign which is very important. The <nowiki>==</nowiki> Checks a function which is being used alot. A small example of the "<nowiki>==</nowiki>"
if(this->player->character->clas == 1){this->player->character->str += 5;}
<pre>if(this->player->character->clas == 1)
{
this->player->character->str += 5;
}</pre>
As you see i used the == as a check. The == in this line will check if a player is class 1. (Peasant) If that is true than it will continue and read the next line. So if the check is correct That means that you are class peasant than you will get 5 strength. This can be used everywhere. But dontgetconfused.. if(this->player->character->clas = 1){this->player->character->str +=5:}
Look at the second line. That is NOT the same as == It will give you errors. The == CHECKS something but the = does NOT.
As you see i used the <nowiki>==</nowiki> as a check. The <nowiki>==</nowiki> in this line will check if a player is class 1. (Peasant) If that is true than it will continue and read the next line. So if the check is correct That means that you are class peasant than you will get 5 strength. This can be used everywhere. But dont get confused.. if(this->player->character->clas = 1){this->player->character->str +=5:}
Look at the second line. That is NOT the same as <nowiki>==</nowiki> It will give you errors. The <nowiki>==</nowiki> CHECKS something but the = does NOT.
The = Sign?
The <nowiki>=</nowiki> Sign?
The = Sign is different than the == Sign. The = sign The " = " Makes something come true like a wish =P I will give you an example:
The <nowiki>=</nowiki> Sign is different than the <nowiki>==</nowiki> Sign. The <nowiki>=</nowiki> sign The "<nowiki>=</nowiki>" Makes something come true like a wish <nowiki>=</nowiki>P I will give you an example:
if(this->player->character->usage < 1){this->player->character->clas = 1;}
<pre>if (this->player->character->usage < 1)
{
this->player->character->clas = 1;
}</pre>
This is what happens: IF the player's usage is less than 1 than it will make the player's class 1. So the = basicly makes something. I can use it in all kind of ways. So this will make clear that the=can NEVER be used as check but it makes something true.
This is what happens: IF the player's usage is less than 1 than it will make the player's class 1. So the <nowiki>=</nowiki> basicly makes something. I can use it in all kind of ways. So this will make clear that the <nowiki>=</nowiki> can NEVER be used as check but it makes something true.
->home = "HomeTown";
<pre>->home = "HomeTown";
->name = "Helzfire";
->name = "Helzfire";</pre>
EOSERV Wiki > Page: Basic C plus plus guide > History > Revision Diff