Jump to content

Data Types and operators


_Seb1

5 posts in this topic

Recommended Posts

Updated

This is more an information post for people that don't know what as example an int is. I will explain this here.


Data Types: 
Int: comes from the word Integer and is a variable that can only hold full figures like 1, 56, -8 etc. 
Float or Double: these are floating point numbers like 4,6 12,7 the decimals are limited though.
Char: comes from "character" it is a variable used to save only characters such as: K, L, k, l
String: Well a String is basicilly a char array. A string contains more than one character as example full words.
Before we come to the last Data Type, I have to say that a char is always saved with an apostrophe ' 
as example: 'H' the string uses the " signs so: "hello".
Booleans: Booleans are variables that contain wheither a "true" or "false" value.

Now because we want to connect the variables with eachother we need operators:
arithmetic operators
compare operators
logic operators
Non of them are hard when you don't understand them the first time read it another time. Operators and algos are important for coding(algorythms are excluded here) as well as sortalgorymths such as Insertionsort(picks a random number out of a list and then sorts it after that), Mergesort(list gets divided in two different lists and always divided again and merged at the end) and bubblesort(I have no idea).

arithmetic operators
addition(+), substraction(-), multiplication(*), division(/), [salvage value(%)]
[Salvage value: if you divide two int values with eachother, just a full figure will be displayed the salvage value is for getting non divided value example: 
int restvalue;
restvalue = 17 % 5;
it would display 2.]

compare operators
compare operators are used to compare most likely numeric elements. the result is this is always a boolean value, which can be saved in a boolean variable.
compare operators are:
less <
less-equal <=
greater >
grater-equal >=
equal ==(two because one = sign is used to allocate values to variables, so the "equal" operator is a ==)
disparate != or <>

logic operators
with those operators you are able to connect boolean values with eachother, these operators operate on bool variables there are 4 logic operators.
Negationoperator: it negates the containment of a boolean value. is the value false the negationoperator turns it into true is it true it turns it into false. The Negationoperator is displayed by a !
exampls.:
bool trueorfalse1;
trueorfalse1 = false;

bool trueorfalse2;
trueorfalse2 = !trueorfalse1
trueorfalse2 has the value true now.

and-operator
an and-operator is used to connect 2 boolean values if both values are true. In every other cause it would display false. its realized through a double &
example.
bool trueorfalse1, trueorfalse2, trueorfalse3;
trueorfalse1 = true;
trueorfalse2 = false;
trueorfalse3 = true;

bool result1, result2;
result1 = trueorfalse1 && trueorfalse2;
result2 = trueorfalse1 && trueorfalse3;
result1 will be false and result2 will be true.

Or-operator
it connects 2 variables witheachother and displays true, if. at least one of the values are true. The command is a | |.
example.:

bool trueorfalse1, trueorfalse2;
trueorfalse1 = false;
trueorfalse2 = true;

bool result1, result2, result3;
result1 = trueorfalse1 | | trueorfalse2;
result2 = trueorfalse1 | | false
result3 = 3 = 3(true) | | false

result1 has the value true, result2 the value false, result3 has the value true.


either-or-operator
connects 2 bools with eachother and displays true if at exact 1 value is true, in all over causes its false, its realized through a circumflex ^.
example:
bool eitheror1, eitheror2;
eitheror1 = true ^ true;
eitheror2 = true ^ false;
eitheror1 is false and eitheror2 is true.


Then you can combine operators.
int result1, result2;
result1 = 2 + 3 + 4 - 5
result2 = 4 + 20 / 3 - 8 * 2;
 

-Seb

Enjoy

Posted
17 minutes ago, Joka said:

If you spelt racecar backwards, it would still be racecar 

(⌐■_■) 

19 minutes ago, Zimon said:

plz no hide <_< 

ok I‘ll edit it away.

Archived

This topic is now archived and is closed to further replies.

  • Our picks

    • Samkok Heroes TD Dynasty Tower Defense v1.0.174 [ +8 Cheats ] ViP Active
      Modded/Hacked App: Samkok Heroes TD By Suga Pte. Ltd.
      Bundle ID: co.imba.threekingdoms.towerdefense
      App Store Link: https://apps.apple.com/us/app/samkok-heroes-td/id6758647943?uo=4
      🤩 Hack Features

      - HP MAX
      - ATK MAX
      - iGG Speed X6 / Wave Skiper
      ::::: VIP :::::
      - ViP Active
      - ADS No
      - Special Pack Daily / Rewards Claim Unlimited
      - Special Pack Weekly / Rewards Claim Unlimited
      - Special Pack Monthly / Rewards Claim Unlimited
      - Hero Unlocked
      • 16 replies
    • Samkok Heroes TD Dynasty Tower Defense v1.0.174 [ +8 Jailed ] ViP Active
      Modded/Hacked App: Samkok Heroes TD By Suga Pte. Ltd.
      Bundle ID: co.imba.threekingdoms.towerdefense
      App Store Link: https://apps.apple.com/us/app/samkok-heroes-td/id6758647943?uo=4

      🤩 Hack Features

      - HP MAX
      - ATK MAX
      - iGG Speed X6 / Wave Skiper
      ::::: VIP :::::
      - ViP Active
      - ADS No
      - Special Pack Daily / Rewards Claim Unlimited
      - Special Pack Weekly / Rewards Claim Unlimited
      - Special Pack Monthly / Rewards Claim Unlimited
      - Hero Unlocked
      • 11 replies
    • Corner Cafe: Merge puzzle game v1.11 [ +3 Cheats ] Currency Max
      Modded/Hacked App: Corner Cafe : Merge & Cook By Alchemical Inc
      Bundle ID: com.grilltown.grill
      App Store Link: https://apps.apple.com/ph/app/corner-cafe-merge-cook/id6748403232?uo=4

      🤩 Hack Features

      - Unlimited Cash / Earn Then Get
      - Unlimited Coins / Sell Items Then Get
      - Unlimited Energy
      • 8 replies
    • Corner Cafe: Merge puzzle game v1.11 [ +3 Jailed ] Currency Max
      Modded/Hacked App: Corner Cafe : Merge & Cook By Alchemical Inc
      Bundle ID: com.grilltown.grill
      App Store Link: https://apps.apple.com/ph/app/corner-cafe-merge-cook/id6748403232?uo=4

      🤩 Hack Features

      - Unlimited Cash / Earn Then Get
      - Unlimited Coins / Sell Items Then Get
      - Unlimited Energy
      • 5 replies
    • Tower King! v1.10.0 [ +3 Cheats ] Easy Win
      Modded/Hacked App: Tower King! By Playmotional Limited
      Bundle ID: com.playmotional.defense
      App Store Link: https://apps.apple.com/us/app/tower-king/id6743542031?uo=4

      🤩 Hack Features

      - Unlimited Coins / AFK Reward
      - Unlimited Exp / LvL Faster UP / AFK Reward
      - DMG / Linked But Use Tower Easy To Win
      • 20 replies
    • Tower King! v1.10.0 [ +3 Jailed ] Easy Win
      Modded/Hacked App: Tower King! By Playmotional Limited
      Bundle ID: com.playmotional.defense
      App Store Link: https://apps.apple.com/us/app/tower-king/id6743542031?uo=4

      🤩 Hack Features

      - Unlimited Coins / AFK Reward
      - Unlimited Exp / LvL Faster UP / AFK Reward
      - DMG / Linked But Use Tower Easy To Win
      • 17 replies
    • Everybody's RPG v5.94 [ +7 Cheats ] Currency Max
      Modded/Hacked App: Everybody's RPG By Seung Jae Lee
      Bundle ID: com.nomadgames.everybodyrpgpay
      iTunes Store Link: https://apps.apple.com/us/app/everybodys-rpg/id1353701442?uo=4


      🤩 Hack Features

      - Currency Max

      - DMG

      - ATK Speed

      - ATK Range

      - Skill CD

      - Enemy Freeze

      - Enemy NO [ Stage Mod ] Easy Skip Stage

      Don't Abuse The Hack Incase Banned
      • 28 replies
    • Everybody's RPG v5.94 [ +7 Jailed ] Currency Max
      Modded/Hacked App: Everybody's RPG By Seung Jae Lee
      Bundle ID: com.nomadgames.everybodyrpgpay
      iTunes Store Link: https://apps.apple.com/us/app/everybodys-rpg/id1353701442?uo=4


      🤩 Hack Features

      - Currency Max

      - DMG

      - ATK Speed

      - ATK Range

      - Skill CD

      - Enemy Freeze

      - Enemy NO [ Stage Mod ] Easy Skip Stage

      Don't Abuse The Hack Incase Banned
      • 39 replies
    • Eras of Wrestling v1.0.28 [ +4 Jailed ] Currency Max
      Modded/Hacked App: Eras of Wrestling By Checkmate Creative LLC
      Bundle ID: cc.eras
      App Store Link: https://apps.apple.com/us/app/eras-of-wrestling/id6569255567?uo=4

      🤩 Hack Features

      - Unlimited Cash
      - Unlimited Gold Token
      - Unlimited Silver Token
      - Unlimited Red Token
      • 2 replies
    • Eras of Wrestling v1.0.28 [ +4 Cheats ] Currency Max
      Modded/Hacked App: Eras of Wrestling By Checkmate Creative LLC
      Bundle ID: cc.eras
      App Store Link: https://apps.apple.com/us/app/eras-of-wrestling/id6569255567?uo=4

      🤩 Hack Features

      - Unlimited Cash
      - Unlimited Gold Token
      - Unlimited Silver Token
      - Unlimited Red Token
      • 5 replies
    • ZombTube v1.2.366 [ +11 Jailed ] Currency Max
      Modded/Hacked App: ZombTube By Dmytro Drach
      Bundle ID: com.booblyc.ZombTubeGame
      iTunes Store Link: https://apps.apple.com/us/app/zombtube/id6464316230?uo=4


      Hack Features:

      - IAP Free

      - No ADS

      - Red coins

      - Gold

      - Parts - Upgrade Free Guns-Items

      - Damage

      - Bullet Range

      - Gun Range

      - Ammo

      - No Reload

      - Accuracy
      • 10 replies
    • ZombTube v1.2.366 [ +11 Cheats ] Currency Max
      Modded/Hacked App: ZombTube By Dmytro Drach
      Bundle ID: com.booblyc.ZombTubeGame
      iTunes Store Link: https://apps.apple.com/us/app/zombtube/id6464316230?uo=4


      Hack Features:
      - IAP Free

      - No ADS

      - Red coins

      - Gold

      - Parts - Upgrade Free Guns-Items

      - Damage

      - Bullet Range

      - Gun Range

      - Ammo

      - No Reload

      - Accuracy
      • 51 replies
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines