Close



Keep me logged in.

Forgot your password? | Register Now

Results 1 to 3 of 3
  1. Original Post
    I'm the Original
    Correy's Avatar

    Default [C#] - Understanding Arrays




    This tutorial is to help you understand arrays using the CSharp coding format.

    Now if you do not know what a array is or used for read the spoiler below.
    - A array is used the set more then one value to a variable.
    - Arrays are used highly in encryption & decryption scripts.
    - Arrays can be used for the application to add its self multiple variables depending on a file etc.

    How to make and set values to an array:
    A array is set as any other variable just with [] at the end.
    Code:
    Int[] ArrayName;
    In the [] is where you set the amount of values you would like the variable to store.
    Code:
    Int[3] ArrayName;
    To set a value in each array you will do this.
    NOTE: the system counts from 0 not 1 so always stay one behind.
    Code:
    Int ArrayName[3];
    ArrayName[0] = 40;
    ArrayName[1] = 37;
    ArrayName[2] = 86;
    This is a faster way i use to set values.

    Code:
    Int ArrayName[3] = {40, 37, 86};

    How to set a number of values though a variable:

    There is not much needed to explain how this works,
    with basic knowledge of C# you will understand.
    Code:
    Int ArrayName[] = {37, 43, 54};
    int i;
    for(i=0; i<3; i++)
    {
          String Summary = "This Is Generated : " + ArrayName[i];
    }
     
    Last edited by Elkyeim; 07-26-2012 at 01:58 PM.
    Register or log in to view signatures.

  2. The Following User Says Thank You to Correy For This Useful Post:


  3. #2
    Junior Ranger

    Default

    Great tutorial!!!! thanks
    Register or log in to view signatures.

  4. The Following User Says Thank You to e1usive For This Useful Post:


  5. #3
    I am the one who knocks
    Elkyeim's Avatar

    Default

    Quote Originally Posted by Correy View Post
    This tutorial is to help you understand arrays using the CSharp coding format.

    Now if you do not know what a array is or used for read the spoiler below.
    - A array is used the set more then one value to a variable.
    - Arrays are used highly in encryption & decryption scripts.
    - Arrays can be used for the application to add its self multiple variables depending on a file etc.

    How to make and set values to an array:
    A array is set as any other variable just with [] at the end.
    Code:
    Int[] ArrayName;
    In the [] is where you set the amount of values you would like the variable to store.
    Code:
    Int[3] ArrayName;
    To set a value in each array you will do this.
    NOTE: the system counts from 0 not 1 so always stay one behind.
    Code:
    Int ArrayName[3];
    ArrayName[0] = 40;
    ArrayName[1] = 37;
    ArrayName[2] = 86;
    This is a faster way i use to set values.

    Code:
    Int ArrayName[3] = {40, 37, 86};

    How to set a number of values though a variable:

    There is not much needed to explain how this works,
    with basic knowledge of C# you will understand.
    Code:
    Int ArrayName[] = {37, 43, 54};
    int i;
    for(i=0; i<3; i++)
    {
          String Summary = "This Is Generated : " + ArrayName[i];
    }
    Once again, moved to Programming tutorials. :needa:
    Great tutorial by the way! There all amazing.
    Register or log in to view signatures.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •