Monday:
Monday was not a very exciting double, considering all I was doing was trying to figure out what pointers did, how structures worked, and started working on arrays. I moved on from pointers unsuccessfully. I realize what they do, just not how they work. The tutorial was not very helpful, for it was more of a complicated example than an actual tutorial. So I moved on to structures, which made a bit more sense. Structures are used mostly for database programs, as it would seem.
int main()
{
database employee;
employee.age = 22;
employee.id_number = 543927;
employee.salary = 12000.21;
Structures and pointers are probably not going to play a big part in our project for now, unless someone flies out of the sky and explains it to me in layman terms.
With that, I moved on to arrays. An array is basically a matrix, but not quite. A more correct wording is that a matrix is an array. After writing out the tutorial and seeing that it worked, I decided to mess around with the numbers a bit. The double was over by now, and due to school holidays and snow days, I didn't have class until Friday, which was a short class.
Today
Today I messed around with the arrays some more. Essentially, I was just doing the same thing. Here is the code:
#include
using namespace std;
int main()
{
int x;
int y;
int array[50][50];
for ( x = 0; x < 50; x++ ) {
for ( y = 0; y < 50; y++ )
array[x][y] = x + y;
}
cout<<"Array Indices:\n";
for ( x = 0; x < 50; x++ ) {
for ( y = 0; y < 50; y++ )
cout<<" "<< array[x][y] <<" ";
cout<<"\n";
}
cin.get();
system("\n pause");
}
It makes a 50 x 50 array of x + y.
That's it for now.