Thread: Array Basics

Results 1 to 10 of 10
  1. #1
    ASERHaerheadrherherh's Avatar
    Join Date
    Mar 2014
    Gender
    male
    Location
    California
    Posts
    716
    Reputation
    23
    Thanks
    93
    My Mood
    Angelic

    Array Basics

    Going to try and do my best on explaining arrays (Sorry if it's wrong):

    The Basics
    My compsci teacher always tells me this: imagine a shelf, x by y, in which you can put items (variables) in the slots.

    For example: a 3x3 array would look like this:
    Code:
       |   |   
    ___|___|___
       |   |   
       |   |   
    ___|___|___
       |   |   
       |   |
    Usually arrays work like regular grid boxes: you define them based on row and then column:
    For example, (3,2) would refer to the box on the third row and the second column, usually.

    Important things to know:
    -In coding, everything starts at 0; if you want to look at the first row and the first column, instead of doing (1,1) you would do (0,0).

    Arrays can also be three dimensional, four dimensional, or if you really want, 10 dimensional.

    WIP, will get back to it later, but I gotta go and do something and I'm lazy to do a google doc.
    Last edited by ASERHaerheadrherherh; 02-08-2017 at 10:51 AM.

  2. The Following 2 Users Say Thank You to ASERHaerheadrherherh For This Useful Post:

    Greythorne (08-20-2018),Jorndel (02-12-2017)

  3. #2
    Zenitram's Avatar
    Join Date
    Jan 2017
    Gender
    male
    Location
    Cafe Nowhere
    Posts
    1,609
    Reputation
    82
    Thanks
    203
    My Mood
    Happy
    I was looking for that because it's a quite hard to understand the arrays (and more for begginers like me). I have a question, does the arrays are the same on every programming language? (like C++ and C#). Thank you.

  4. #3
    ASERHaerheadrherherh's Avatar
    Join Date
    Mar 2014
    Gender
    male
    Location
    California
    Posts
    716
    Reputation
    23
    Thanks
    93
    My Mood
    Angelic
    Quote Originally Posted by jbmhbleach97 View Post
    I was looking for that because it's a quite hard to understand the arrays (and more for begginers like me). I have a question, does the arrays are the same on every programming language? (like C++ and C#). Thank you.
    If you are talking about how arrays are stored, then yes, I believe so.
    However, different languages might have different pieces of code (idk what it is called, my mind blanked out) to assign variables to arrays.

  5. The Following User Says Thank You to ASERHaerheadrherherh For This Useful Post:

    Zenitram (02-09-2017)

  6. #4
    Zenitram's Avatar
    Join Date
    Jan 2017
    Gender
    male
    Location
    Cafe Nowhere
    Posts
    1,609
    Reputation
    82
    Thanks
    203
    My Mood
    Happy
    Quote Originally Posted by MrSurvivor View Post
    If you are talking about how arrays are stored, then yes, I believe so.
    However, different languages might have different pieces of code (idk what it is called, my mind blanked out) to assign variables to arrays.
    That is i was looking for, remembering how arrays are stored, doesn't matter if i need to use another language, it just the fact that i know how to use the arrays. Thank you for your answer.

  7. #5
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Just want to mention that there is different types of arrays.

    You have the standard that is like: [0|1|2|3|4]
    This stores just a single value on each position.

    Then you have array-of-arrays (jagged array) that is more like two rows:
    [1|2]
    [1|2]
    [1|2]


    And then as explained I think you have matrix array:
    [1|2|3]
    [4|5|6]
    [7|8|10]



    Might be wrong on some parts since I've not used arrays that much besides a single value array
    -But they all are handy for their own things ofc

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  8. #6
    Silent's Avatar
    Join Date
    Jan 2015
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    5,070
    Reputation
    2172
    Thanks
    8,474
    My Mood
    Bitchy
    Nice, But how do 'nested' arrays get stored in memory?
    Click Here to visit the official MPGH wiki! Keep up with the latest news and information on games and MPGH! To check out pages dedicated to games, see the links below!











    dd/mm/yyyy
    Member - 31/01/2015
    Premium - 12/09/2016
    Call of Duty minion - 05/11/2016 - 05/11/2019
    BattleOn minion - 28/02/2017 - 05/11/2019
    Battlefield minion - 30/05/2017 - 05/11/2019
    Other Semi-Popular First Person Shooter Hacks minion - 21/09/2017 - 17/09/2019
    Publicist - 07/11/2017 - 02/08/2018
    Cock Sucker - 01/12/2017 - Unknown
    Minion+ - 06/03/2018 - 05/11/2019
    Fortnite minion - 08/05/2018 - 05/11/2019
    Head Publicist - 08/10/2018 - 10/01/2020
    Developer Team - 26/10/2019 - 10/01/2020
    Former Staff - 10/01/2020



  9. #7
    Nimboso's Avatar
    Join Date
    Sep 2015
    Gender
    male
    Posts
    554
    Reputation
    21
    Thanks
    2,635
    Quote Originally Posted by JamesBond View Post
    Nice, But how do 'nested' arrays get stored in memory?
    IIRC arrays are just a pointer to a chunk of allocated memory. So the first array is just a bunch of pointers to your second arrays.
    Last edited by Nimboso; 02-23-2017 at 10:52 AM.

  10. #8
    Silent's Avatar
    Join Date
    Jan 2015
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    5,070
    Reputation
    2172
    Thanks
    8,474
    My Mood
    Bitchy
    Quote Originally Posted by Nimboso View Post
    IIRC arrays are just a pointer to a chunk of allocated memory. So the first array is just a bunch of pointers to your second arrays.
    I had a feeling that's how it would work. Just could've been bothered googling xd.
    Click Here to visit the official MPGH wiki! Keep up with the latest news and information on games and MPGH! To check out pages dedicated to games, see the links below!











    dd/mm/yyyy
    Member - 31/01/2015
    Premium - 12/09/2016
    Call of Duty minion - 05/11/2016 - 05/11/2019
    BattleOn minion - 28/02/2017 - 05/11/2019
    Battlefield minion - 30/05/2017 - 05/11/2019
    Other Semi-Popular First Person Shooter Hacks minion - 21/09/2017 - 17/09/2019
    Publicist - 07/11/2017 - 02/08/2018
    Cock Sucker - 01/12/2017 - Unknown
    Minion+ - 06/03/2018 - 05/11/2019
    Fortnite minion - 08/05/2018 - 05/11/2019
    Head Publicist - 08/10/2018 - 10/01/2020
    Developer Team - 26/10/2019 - 10/01/2020
    Former Staff - 10/01/2020



  11. #9
    Breakdancer12345's Avatar
    Join Date
    Oct 2018
    Gender
    male
    Posts
    21
    Reputation
    10
    Thanks
    0
    Cheers for the information. It will be useful for the newer coders.

  12. #10
    Slazi's Avatar
    Join Date
    Mar 2021
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    0
    Thanks you very much

Similar Threads

  1. Basic Animation
    By Chronologix in forum Tutorials
    Replies: 29
    Last Post: 09-15-2008, 09:05 AM
  2. Basic Signature
    By Chronologix in forum Tutorials
    Replies: 68
    Last Post: 09-25-2007, 12:33 AM
  3. Basic Codecaves with FEAR as an example.
    By Zededarian in forum Game Hacking Tutorials
    Replies: 0
    Last Post: 09-23-2006, 08:32 PM
  4. [Help] Atom API with Visual Basic 6.0 or .NET
    By Bull3t in forum Visual Basic Programming
    Replies: 5
    Last Post: 07-23-2006, 09:21 AM
  5. Packets & Visual Basic
    By BadBob in forum Hack Requests
    Replies: 5
    Last Post: 07-20-2006, 09:28 PM