Jump to content

Array value in array index

Guest

Basically I want to use a value that was assigned to an array before as an array index

 

arrayexample [1] = 60;

Now I want to use 60 as an array index

arrayin [60];

But not by typing 60 directly but rather

arrayin [arrayexample [1] ];

wonder if that's possible

Link to comment
Share on other sites

Link to post
Share on other sites

That is exactly what you do.

 

If you need further help then at least specify language.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Mr_KoKa said:

That is exactly what you do.

 

If you need further help then at least specify language.

C :D

Most languages are similar

Link to comment
Share on other sites

Link to post
Share on other sites

That is true, but for example, visual basic does use regular brackets instead square ones to access array index. But your code would work in the most languages I know.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×