Jump to content

Functions and classes explained


_Seb1

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.

 

 

 

Archived

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

  • Our picks

    • Jet Cat: Idle Merge Shooter v0.2.6 [ +5 Cheats ] Enough Currency
      Modded/Hacked App: Jet Cat: Idle Merge Shooter By ACTIONFIT Ltd.
      Bundle ID: com.actionfit.jet.cat.bang.cat.ios
      App Store Link: https://apps.apple.com/us/app/jet-cat-idle-merge-shooter/id6795411918?uo=4

      🤩 Hack Features

      - Auto ADS NO
      - Enough Currency
      - ATK MAX
      - ATK Speed
      - Gold Max / Enemy Drop
      • 0 replies
    • Jet Cat: Idle Merge Shooter v0.2.6 [ +5 Jailed ] Enough Currency
      Modded/Hacked App: Jet Cat: Idle Merge Shooter By ACTIONFIT Ltd.
      Bundle ID: com.actionfit.jet.cat.bang.cat.ios
      App Store Link: https://apps.apple.com/us/app/jet-cat-idle-merge-shooter/id6795411918?uo=4

      🤩 Hack Features

      - Auto ADS NO
      - Enough Currency
      - ATK MAX
      - ATK Speed
      - Gold Max / Enemy Drop
      • 0 replies
    • Pixel Defenders: Merge TD Game +5 Mods [ Damage & Defence ]
      Mod APK Game Name: Pixel Defenders: Merge TD Game By ONDI TECHNOLOGY JSC
      Rooted Device: Not Required.
      Google Play Store Link: https://play.google.com/store/apps/details?id=com.ondi.fortias.defense

       

      🤩 Hack Features

      - Unit Damage Multiplier
      - Unit Defence Multiplier
      - Unit God Mode
      - Castle Defence Multiplier
      - Castle God Mode
      • 3 replies
    • Marmot Defense: Rogue Survival +2 Jailed Cheats [ Damage + More ]
      Modded/Hacked App: Marmot Defense: Rogue Survival By Bad Beans Co., Ltd
      Bundle ID: com.badbeans.legendofmarmot
      App Store Link: https://apps.apple.com/ph/app/marmot-defense-rogue-survival/id6749559874?uo=4

       

      🤩 Hack Features

      - Damage Multiplier
      - God Mode
      • 1 reply
    • Galactic Outlaw: Tower Defense +3 Mods [ Damage & Defence ]
      Mod APK Game Name: Galactic Outlaw: Tower Defense By Purplecow games
      Rooted Device: Not Required.
      Google Play Store Link: https://play.google.com/store/apps/details?id=com.cookapps.towerroguedefense

       

      🤩 Hack Features

      - Damage Multiplier
      - Defence Multiplier
      - God Mode
      • 1 reply
    • Hell Hero : Idle RPG +4 Mods [ Damage & Defence ]
      Mod APK Game Name: Hell Hero : Idle RPG By UModeler Inc.
      Rooted Device: Not Required.
      Google Play Store Link: https://play.google.com/store/apps/details?id=com.umodeler.hellheroidlerpg

       

      🤩 Hack Features

      - Damage Multiplier
      - Defence Multiplier
      - God Mode
      - XP Multiplier
      • 0 replies
    • Packingdom +4 Mods [ Unlimited Currencies ]
      Mod APK Game Name: Packingdom By ABI GLOBAL LTD.
      Rooted Device: Not Required.
      Google Play Store Link: https://play.google.com/store/apps/details?id=com.abi.packingdom

       

      🤩 Hack Features

      - Gold Modifier -> Earn or spend some.
      - Heart Modifier -> Earn or spend some.
      - Booster Modifier -> Earn or spend some.
      - Pre-Booster Modifier -> Earn or spend some.
      • 0 replies
    • Dungeon Sisters : IDLE RPG +4 Jailed Cheats [ Damage & Defence ]
      Modded/Hacked App: Dungeon Sisters : IDLE RPG By Lobstar Games Corp.
      Bundle ID: com.lobstargames.dungeon.idle.rpg
      App Store Link: https://apps.apple.com/us/app/dungeon-sisters-idle-rpg/id6737465125?uo=4

       


      🤩 Hack Features

      - Damage Multiplier
      - Defence Multiplier
      - God Mode
      - No Skill Cooldown
      • 62 replies
    • Packingdom +4 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Packingdom By ABIGAMES PTE. LTD
      Bundle ID: com.abi.packingdom
      App Store Link: https://apps.apple.com/us/app/packingdom/id6760441822?uo=4

       

      🤩 Hack Features

      - Gold Modifier -> Earn or spend some.
      - Heart Modifier -> Earn or spend some.
      - Booster Modifier -> Earn or spend some.
      - Pre-Booster Modifier -> Earn or spend some.
      • 0 replies
    • Weaponia +4++ Jailed Cheats [ Damage & Defence ]
      Modded/Hacked App: Weaponia By OCTOPO Corp.
      Bundle ID: com.octopo.warofweapons
      App Store Link: https://apps.apple.com/us/app/weaponia/id6502043182?uo=4

       

      🤩 Hack Features

      - Damage Multiplier
      - Defence Multiplier
      - God Mode

      VIP
      - Currency Modifier -> Earn or spend some.
      • 1 reply
    • FAIRY TAIL Wizard Chronicle +2 Jailed Cheats
      Modded/Hacked App: FAIRY TAIL Wizard Chronicle By GOODROID,Inc.
      Bundle ID: jp.co.goodroid.fairy
      App Store Link: https://apps.apple.com/us/app/fairy-tail-wizard-chronicle/id6746717958?uo=4

       

      📌 Mod Requirements

      - Non-Jailbroken/Jailed or Jailbroken iPhone or iPad.
      - Sideloadly or alternatives.
      - Computer running Windows/macOS/Linux with iTunes installed.

       

      🤩 Hack Features

      - Damage Multiplier
      - Defense Multiplier

       

      ⬇️ iOS Hack Download IPA Link


      Hidden Content

      Download via the iOSGods App







       

      📖 PC Installation Instructions

      STEP 1: Download the pre-hacked .IPA file from the link above to your computer. To download from the iOSGods App, see our iOSGods App IPA Download Tutorial which includes a video example.
      STEP 2: Download Sideloadly and install it on your Windows or Mac.
      STEP 3: Open Sideloadly on your computer, connect your iOS device, and wait until your device name appears in Sideloadly.
      STEP 4: Once your iDevice is recognized, drag the modded .IPA file you downloaded and drop it into the Sideloadly application.
      STEP 5: Enter your Apple Account email, then press “Start.” You’ll then be asked to enter your password. Go ahead and provide the required information.
      STEP 6: Wait for Sideloadly to finish sideloading/installing the hacked IPA. If there are issues during installation, please read the note below.
      STEP 7: Once the installation is complete and you see the app on your Home Screen, you will need to go to Settings -> General -> Profiles / VPN & Device Management. Once there, tap on the email you entered from step 6, and then tap on 'Trust [email protected]'.
      STEP 8: Now go to your Home Screen and open the newly installed app and everything should work fine. You may need to follow further per app instructions inside the hack's popup in-game.

      NOTE: iOS/iPadOS 16 and later, you must enable Developer Mode. For free Apple Developer accounts, you will need to repeat this process every 7 days. If you have any questions or problems, read our Sideloadly FAQ section of the topic and if you don't find a solution, please post your issue below and we'll do our best to help! If the hack does work for you, post your feedback below and help out other fellow members that are encountering issues.

       

      🙌 Credits

      - AlyssaX64

       

      📷 Cheat Video/Screenshots

      N/A
      • 37 replies
    • RELLION: NPC Survival +3 Jailed Cheats
      Modded/Hacked App: RELLION: NPC Survival By DAERI SOFT
      Bundle ID: com.daerigame.rellion
      App Store Link: https://apps.apple.com/us/app/rellion-npc-survival/id6757416807?uo=4

       

      📌 Mod Requirements

      - Non-Jailbroken/Jailed or Jailbroken iPhone or iPad.
      - Sideloadly or alternatives.
      - Computer running Windows/macOS/Linux with iTunes installed.

       

      🤩 Hack Features

      - Damage Multiplier
      - Defense Multiplier
      - Currencies Multiplier

       

      ⬇️ iOS Hack Download IPA Link


      Hidden Content

      Download via the iOSGods App







       

      📖 PC Installation Instructions

      STEP 1: Download the pre-hacked .IPA file from the link above to your computer. To download from the iOSGods App, see our iOSGods App IPA Download Tutorial which includes a video example.
      STEP 2: Download Sideloadly and install it on your Windows or Mac.
      STEP 3: Open Sideloadly on your computer, connect your iOS device, and wait until your device name appears in Sideloadly.
      STEP 4: Once your iDevice is recognized, drag the modded .IPA file you downloaded and drop it into the Sideloadly application.
      STEP 5: Enter your Apple Account email, then press “Start.” You’ll then be asked to enter your password. Go ahead and provide the required information.
      STEP 6: Wait for Sideloadly to finish sideloading/installing the hacked IPA. If there are issues during installation, please read the note below.
      STEP 7: Once the installation is complete and you see the app on your Home Screen, you will need to go to Settings -> General -> Profiles / VPN & Device Management. Once there, tap on the email you entered from step 6, and then tap on 'Trust [email protected]'.
      STEP 8: Now go to your Home Screen and open the newly installed app and everything should work fine. You may need to follow further per app instructions inside the hack's popup in-game.

      NOTE: iOS/iPadOS 16 and later, you must enable Developer Mode. For free Apple Developer accounts, you will need to repeat this process every 7 days. If you have any questions or problems, read our Sideloadly FAQ section of the topic and if you don't find a solution, please post your issue below and we'll do our best to help! If the hack does work for you, post your feedback below and help out other fellow members that are encountering issues.

       

      🙌 Credits

      - AlyssaX64

       

      📷 Cheat Video/Screenshots

      N/A
      • 142 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