Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8454275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:58:58+00:00 2026-06-10T11:58:58+00:00

Keep In mind I don’t have much coding experience… I’m having problem’s accessing an

  • 0

Keep In mind I don’t have much coding experience…

I’m having problem’s accessing an Array.
I’m creating the Array using a function that returns a Array here’s an example:

int[] ArrayName = ReturnArray(string);

So now that ArrayName has been created it should be identical to what ReturnArray returned should it not?

Well I set a breakpoint right on :

int[] ArrayName = ReturnArray(string);

I can see that ArrayName was created properly.

Well when I try to access just 1 value of the Array like so:

print(ArrayName[0]);

It should only return the first value in the array right? well It’s not!
It returns a MORE THAN ONE VALUE and the value’s Don’t even match what ReturnArray(string) Returned

Here is the “ReturnArray” function :

    public static int[] ReturnArray(string t)
    {
        int i,ii,;
        string ba;
        string base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
        List<int> list = new List<int>();
        for (i = 0; i < t.Length;i++)
        {
            ba = t.Substring(i, 1);
            ii = base64.IndexOf(ba) * 64;
            list.Add(ii);
        }
        return list.ToArray();
    }

Added more code do to response’s from comments

    private void outputLoop()
    {
        int i = 0;
            for (i = 0; i < 63; i++)
            {
                int te = lines[i].Length - 128;
                string tes = lines[i].Substring(te, 64);
                int[] ArrayName = ReturnArray(tes);
                _textlayer.DrawString(_font, ArrayName[i].ToString(), new Vector2(1100, i * 15), Color.White);
          }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:58:59+00:00Added an answer on June 10, 2026 at 11:58 am

    Here’s a working sample. Let’s deconstruct.

    static void Main( string[] args ) {
        // declare a variable and assign it to the return value of ReturnArray()
        var arr = ReturnArray( "foo" ); 
    
        // get the first value in the array
        var first = arr[0];
    }
    
    public static int[] ReturnArray( string t ) {
        int i, ii;
        string ba;
        string base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
        List<int> list = new List<int>();
        for( i = 0; i < t.Length; i++ ) {
            ba = t.Substring( i, 1 );
            ii = base64.IndexOf( ba ) * 64;
            list.Add( ii );
        }
        return list.ToArray();
    }
    

    First, if you are trying to make a base 64 algorithm, it’s already been done and in the framework. If you are trying to learn, that’s great, but there are examples out there to go on.

    ii = base64.IndexOf( ba ) * 64;
    

    Secondly, your code does return what I would expect, i.e. an array of numbers which come from the product of IndexOf() * 64.

    This little example yields 1984, 2560, 2560 for “foo” and the value at index 0 is 1984.

    “AAA” yields 0, 0, 0, because IndexOf() is 0 * 64.

    As you would expect, “BBB” yields 64, 64, 64, because IndexOf() returns 1, and it is multiplied by 64.

    More debugging code (based on comments):

    int[] arr = ReturnArray( "DADBALAMANAOAAABAYAZAaAbAcAdAeAff/BIBJBKBLBMBNBOBJBKBLBMBNBOBPf/AAABAoApAqArAsAt‌​AuAvf/f/+4+5f/f/f/AAABf/B4B5B6DQAZAaAbAcAdAeAZAa" );
    
    // should print "192"
    System.Diagnostics.Debug.WriteLine( arr[0] );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(Keep in mind this is on OSX Snow Leopard) I don't know how to
What is important to keep in mind when designing a database? I don't want
I have to keep in mind the priority of operations, all the numbers including
keep in mind I normally use pure as3 and FlashDevelop :) I am really
What are some tips one can keep in mind to speed up jSoup? I
What are some best practices to keep in mind when developing a script program
I am new to programming in general so please keep that in mind when
Keep running into When using the multi-mapping APIs ensure you set the splitOn param
Keep going around circles, but I am still unclear about this. Have a feeling
Please keep in mind that I am new to world of .Net and F#.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.