Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMorphex

Posted 21 December 2012 - 06:05 PM

If you are using Visual Studio it is already compiling your code to exe.

Check your project folders for a bin folder, it should be there.

 

Other than that, arrays:

Array are just a "bag" of something. for example lets say this, I want to store the name of 100 students.

 

How would you do it?Create 100 variables?

Ok it works. but what If I want to create 1000 students?

 

As you can see it becomes really troublesome to manage, so you create a array of strings in this case.

 

string array[1000]. 

It basically creates space in memory for 1000 strings.

 

To access a value you use array[index] and it returns the value that is stored there.To Save a value you do the same thing, but instead o array[index] = something.

 

Arrays are one of the most useful features in any program language.

 

In your case, this int array[8][8] creates a double indexed array, that means you have 8 positions and each of those positions has 8 more.

So in total you have 64 positions.

 

One example I can give you is, think of it has you have 8 students and each of those students have 8 grades that you need to store.

So each of those students could be simple array that holds grades right?

You could have 8 arrays, but the same as before what if I want 100 students?

You would create a 100 arrays? Why not use a array?

 

That is pretty much what it means.

A double index array is just a array of arrays. You can have in theory any number of arrays like int test[8][8][8][8] depending on your needs ofcourse.

 

 

As your second question, I learned to code by making programs for things that I needed. I needed to calculate vectors for maths class, so I made simple console program to calculate the vectors for me, and so on. Create Programs that are fun to you and at the same time useful, you will be motivated and ideas are everywhere. That is my major advice for you.


#1Morphex

Posted 21 December 2012 - 05:58 PM

If you are using Visual Studio it is already compiling your code to exe. Check your project folders for a bin folder, it should be there.

 

Other than that, arrays:

 

Array are just a "bag" of something.

for example lets say this, I want to store the name of 100 students. How would you do it? Create 100 variables? Ok it works. but what If I want to create 1000 students?

 

As you can see it becomes really troublesome to manage, so you create a array of strings in this case.

string array[1000]. It basically creates space in memory for 1000 strings. 

 

To access a value you use array[index] and it returns the value that is stored there. Arrays are one of the most useful features in any program language.

 

 

In your case, this

 

int array[8][8]

 

creates a double indexed array, that means you have 8 positions and each of those positions has 8 more. So in total you have 64 positions. One example I can give you is, think of it has you have 8 students and each of those students have 8 grades that you need to store.

 

So each of those students could be  simple array that holds grades right? You could have 8 arrays, but the same has before if I want 100 students? You would create a 100 arrays? Why not use a array? 

Thats pretty much what it means.

 

 

As your second question, I learned  to code  by making programs for things that I needed. I needed to calculate vectors for maths class, so I made simple console program to calculate the vectors for me, and so on.

 

 Create Programs that are fun to you and at the same time useful, you will be motivated and ideas are everywhere. That is my major advice for you.


PARTNERS