Jump to content

3 posts in this topic

Recommended Posts

Posted

So in this information thread I will explain what a Class is and what they are used for. Before I can explain what a Class is I must explain Functions and their usage.

The idea behind Functions that the code should be executed multiple times, so it gets outsorced to a Function. Such Functions can be called randomly in the program and if that happens all the Instructions in the function will be executed. The usage of Functions are not only to prevent code doubles. They can be  appointed very flexibal

- While calling the Function up, your able to send Data into it.

- After the Function has ended you can return Data to its calling place.

as example we will take an easy math function:

f(x) = x²

this function can be called with different Parametres and always computes the square of it. When it gets called up with the parametre 2 it delivers 4 as result.

They are able to work more than a math function though:

- the quantity of the parametres aren‘t limited. You can use many parametres.

- The Datatypes(Int, Float/Double etc other thread) are free choosable so you can use strings or booleans too.

- You can return values to its access point.

How is a Function made?

 

Name

Parametres

Return type

Functionstrunk

Must not be like this, but as C++ is very strict about that, you will need to write all that.

Example for a function:

Return Type Functionname(List_of_Parametres)

{(start of the functionstrunk aka Codeblock)

Instruction1;

Instruction2;

....

}

If a Function should not return Data the special return type void is used.

The list of parametres is a seperated list of Datatype-Name-Pairs.(int alpha, string beta)

The return instrction

The return instruction ends the function and gives the data back to its calling place. example the function f(x) = x²:

int f(int x)

{

  int y;

  y = x * x;

  return y;

}

That above is Pseudocode, you can realize it like that but there are parts missing(like defining x).

It is possible to use more than one return instruction. So as example:

int max(int x, int y)

{

 if (x > y)

    return x;

  return y;

}

It checks if x is bigger than y if thats true it gives back the data to its calling place and ends the function. If it is not true it returns y to the calling place and the function ends here.

Failures in the Function code

int max_failmao(int x, int y)

{

 if (x > y)

  return y;

}

👆wrong because there isnt a return instruction defined for x.

void failures

Void return type: Doesnt return values.

So

void Joka( )

{

 return 5;

}

👆failure

You can still use a return instruction in a void function to end it prematurely.

void WithJoka(int x)

{

if (x > 5)

 return;

}

 

Recursions.

Now because this is not used very often due to its high amount of storage eat, you won‘t face it very often.

int Recursionexample()

{

 return( ) + 1

would always call itself up again and add 1 to its parametres. This endlessrecursion would cause a crash of the program. Recursions are a very elegant way to solve problems but it takes muh storage due to its recalls.

 

Classes

What is a „Class“?

A class is an own datatype you can manage after your favor. In those classes objects(so called instances) are saved. So for the class „Human“ Seb, Tronald Dump etc. can be chosen as instances. Characteristic for classes is that all instances have the same skills(So called attributes: howtall; weight).  Every Instance in a class can perform actions: Like baking a cake(humans).

the skills of each instance can vary(not always the same weight).

You can simulate an own similar world with those classes.

How do you realize it in code?

3 parts:

The name

The skills

The actions

So in C++ a class is made like this:

(easy class)

class ClassnameJokaGay

{

..... Skills and actions .....

}

Actions are realized by functions in this actions are called methods of a class if you made it with functions. In the class you can access the skills(attributes)

Classes always have constructures, those methods are used to make new classinstances. Well now we know how to build a class, but what about a Constructor?

A Constructor is made like a function, having the same name like the class and without giving the return type.

ex.:

class score

{

....

   score( )

   {

     quantitygoalsteam1 = 0;

     quantitygoalsteam2 = 0;

   }

}

So because they are playing and they could shoot some goals we need methods to realize that class.

so ex.:

class score

{

 ....

 void goalsteam1( )

{

 quantitygoalsteam1 = quantitygoalsteam1 + 1;

}

Adds a goal to the team

void goalsteam2( )

 {

  quantityofgoalsteam2 =     quantityofgoalsteam2 + 1;

 }

}

So this was now long enough. If I have time I will create one about how to create instances and use them.

 

 

 

  • Like 2
  • Thanks 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below. For more information, please read our Posting Guidelines.
Reply to this topic... Posting Guidelines

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Our picks

    • Fun Run 3 - Multiplayer Games Cheats v4.47.1 +1
      Modded/Hacked App: Fun Run 3: Arena Running Game By Dirtybit
      Bundle ID: com.dirtybit.fra
      iTunes Store Link: https://itunes.apple.com/us/app/fun-run-3-arena-running-game/id1118878857?mt=8&uo=4&at=1010lce4


      Hack Features:
      - God Mode
       

      Hack Download Link: https://iosgods.com/topic/75790-arm64-fun-run-3-arena-running-game-cheats-v210-1/
      • 1,278 replies
    • Super Arrow Online Cheats v1.56.1 +3
      Modded/Hacked App: Super Arrow Idle By MOBIRIX
      Bundle ID: com.mobirix.sao
      iTunes Store Link: https://apps.apple.com/us/app/super-arrow-idle/id1635307668?uo=4


      Hack Features:
      - Infinite Currencies ( Read NOTE )
      - God Mode
      - Weak Enemies ( Enable before start )


      This cheat is fully tested on my device JB ( Odyssey/ Odsseyra1n/ Taurine). If your jailbreak is not supported you will get detection error and do not ask me. AGAIN DO NOT BUY VIP FOR JUST THIS CHEAT

      iOS Hack Download Link: https://iosgods.com/topic/167081-super-arrow-idle-cheats-v154-3/
      • 502 replies
    • My Talking Angela 2 Cheats v25.1.1 +2
      Modded/Hacked App: My Talking Angela 2 By Outfit7 Limited
      Bundle ID: com.outfit7.mytalkingangela2
      iTunes Store Link: https://apps.apple.com/us/app/my-talking-angela-2/id1536584509?uo=4


      Hack Features:
      - Infinite Currencies
      - No Ads


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/147072-my-talking-angela-2-v1013-jailed-cheats-2/


      iOS Hack Download Link: https://iosgods.com/topic/147070-my-talking-angela-2-cheats-all-versions-2/
      • 110 replies
    • My Talking Tom 2 Cheats v25.1.2 +2
      Modded/Hacked App: My Talking Tom 2 by Outfit7 Limited
      Bundle ID: com.outfit7.mytalkingtom2
      iTunes Store Link: https://itunes.apple.com/us/app/my-talking-tom-2/id1337578317?mt=8&uo=4&at=1010lce4



      Hack Features:
      - Infinite Coins (Spend some/ Get some)
      - No Ads


      Hack Download Link: https://iosgods.com/topic/82755-arm64-my-talking-tom-2-cheats-v102002-1/
      • 711 replies
    • Eatventure v1.35.0 Jailed Cheats +2
      Modded/Hacked App: Eatventure By Lessmore UG haftungsbeschraenkt
      Bundle ID: com.hwqgrhhjfd.idlefastfood
      iTunes Store Link: https://apps.apple.com/us/app/eatventure/id1600871388?uo=4


      Hack Features:
      - Freeze Currencies
      - Free iAP (Turn on inside iOSGods Mod Menu first)


      Jailbreak required hack(s): https://iosgods.com/topic/168170-eatventure-cheats-all-versions-1/


      iOS Hack Download IPA Link: https://iosgods.com/topic/168169-eatventure-v110-jailed-cheats-2/
      • 317 replies
    • Dead Ahead: Zombie Warfare Cheats v4.1.9 +4
      Modded/Hacked App: Dead Ahead: Zombie Warfare By Mobirate Studio Ltd
      Bundle ID: com.mobirate.DeadAheadTactics
      iTunes Store Link: https://itunes.apple.com/us/app/dead-ahead-zombie-warfare/id1017311881?mt=8&uo=4&at=1010lce4


      Hack Features:
      - Freeze Coins
      - Freeze Fuels
      - Infinite Mana
      - Instant Warrior Spawn (Show timer but works)

      *NOTE: COULD CAUSE YOU BANNED FROM ONLINE TOURNAMENT, I'M NOT TAKING ANY RESPONSIBILITY. USE WISELY


      Hack Download Link:
      https://iosgods.com/topic/70815-arm64-dead-ahead-zombie-warfare-cheats-v211-4/
      #Hack #Jailbreak #Cydia #Cheat #Apple #Android #iOSGods
      • 781 replies
    • Harry Potter: Hogwarts Mystery v6.4.2 - [ Unlimited Energy & More ]
      Modded/Hacked App: Harry Potter: Hogwarts Mystery By Jam City, Inc.
      Bundle ID: com.tinyco.potter
      iTunes Store Link: https://apps.apple.com/us/app/harry-potter-hogwarts-mystery/id1333256716


      Hack Features:
      - Unlimited Energy
      - Max Attributes Level
      - Free Shop - Energy & Some Pets 
      - Max Creature Mastery Level
      - Unlimited Gems - Do Task And You'll Gain Gems
      - Feeding Button Enabled
      • 865 replies
    • Temple Run 2 Cheats v1.120.0 +8
      Modded/Hacked App: Temple Run 2 by Imangi Studios, LLC
      Bundle ID: com.imangi.templerun2
      iTunes Store Link: https://apps.apple.com/us/app/temple-run-2/id572395608?uo=4&at=1010lce4


      Hack Features:
      - No Ads Enabled
      - x2 Coin Enabled
      - Infinite Coin (Spend some)
      - Infinite Gem (Spend some)
      - All Characters Unlocked
      - Free iAP (Turn off all iap hacks before using this, also if itunes popup don't show then run ldrestart in terminal -- This is an issue with the jailbreak not the hack)
      - Auto Run
      - Coin Magnet


      iOS Hack Download Link: https://iosgods.com/topic/132609-arm64-temple-run-2-cheats-v1691-8/
      • 304 replies
    • Potion Punch 2 Cheats v2.9.60 +1
      Modded/Hacked App: Potion Punch 2 by Monstronauts Inc.
      Bundle ID: com.monstronauts.potionpunch2
      iTunes Store Link: https://apps.apple.com/us/app/potion-punch-2/id1463550435?uo=4&at=1010lce4


      Hack Features:
      - Infinite Currencies
      - Free iAP (Turn this on and use with Free iAP Tweak)


      iOS Hack Download Link: https://iosgods.com/topic/112395-arm64-potion-punch-2-cheats-v102-2/
      • 94 replies
    • [ The Battle Cats JP ] にゃんこ大戦争 Cheats v14.3.2 +3
      Modded/Hacked App: にゃんこ大戦争 By ponos corporation
      Bundle ID: jp.co.ponos.battlecats
      iTunes Store Link: https://apps.apple.com/jp/app/%E3%81%AB%E3%82%83%E3%82%93%E3%81%93%E5%A4%A7%E6%88%A6%E4%BA%89/id547145938?uo=4

       

      📌 Mod Requirements

      - Jailbroken iPhone or iPad.
      - iGameGod / Filza / iMazing.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak (from Sileo, Cydia or Zebra).

       

      🤩 Hack Features

      - Infinite Cash
      - OHK Linked w/ Enemy
      - Infinite Cat Foods & EXP*

       

      Non-Jailbroken Hack: https://iosgods.com/topic/194335-the-battle-cats-jp-%E3%81%AB%E3%82%83%E3%82%93%E3%81%93%E5%A4%A7%E6%88%A6%E4%BA%89-v1432-jailed-cheats-4/

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/194334-the-battle-cats-jp-%E3%81%AB%E3%82%83%E3%82%93%E3%81%93%E5%A4%A7%E6%88%A6%E4%BA%89-cheats-v1432-3/
      • 1 reply
    • Chiikawa Pocket Cheats v1.1.10 +3
      Modded/Hacked App: Chiikawa Pocket By Applibot Inc.
      Bundle ID: jp.co.applibot.chiikawapocketgl
      iTunes Store Link: https://apps.apple.com/us/app/chiikawa-pocket/id6740838442?uo=4

       

      📌 Mod Requirements

      - Jailbroken iPhone or iPad.
      - iGameGod / Filza / iMazing.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak (from Sileo, Cydia or Zebra).

       

      🤩 Hack Features

      - God Mode
      - Multiply Attack

       

      Non-Jailbroken Hack: https://iosgods.com/topic/193718-chiikawa-pocket-v111-jailed-cheats-2/

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/193717-chiikawa-pocket-cheats-v111-2/
      • 30 replies
    • SUPERSTAR JYPNATION Cheats v3.24.0 +3
      Modded/Hacked App: SUPERSTAR JYPNATION By Dalcomsoft Inc.
      Bundle ID: com.dalcomsoft.ss.jyp
      iTunes Store Link: https://apps.apple.com/us/app/superstar-jypnation/id1086866467?uo=4


      Hack Features:
      - Auto Dance
      - Never Lose Combo
      - Always S.Perfect


      iOS Hack Download Link: https://iosgods.com/topic/184872-superstar-jypnation-cheats-v3180-3/
      • 21 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