This is a brief section of what should be learned in class just
as an overview so that everyone starts on the same page.
Don't get me wrong it is fascinating but after
a while it does get tedious unless we stop and think of how this
will be used and is this really used.
So how can this all be
used and is it being used?
Let's consider what an array with no
limits on data type could be used for.
Well...
Everything as
long as your dealing with information.
For example just you yourself are
arrays of structure
how so?
well ...:
The credit company would process the application
and send you the card and that would be it, right?
Wrong!!!!
They would set up an array of structure maybe like
the following:
#include
<stdio.h>
#include
<string.h>
struct
application
{
char Name[20];
char co_app_name [20];
int unsigned
ssn;
int unsigned
co_app_ssn;
int unsigned
phone;
char adress [20];
float total_income_annual;
float credit;
};
int
main()
{struct application applicant[1] =
{{"Adam","Eve",111111111,222222222,7777777,"100 South
Paradise",12600,5000}};
printf("Name = %s, CO App = %s, SSN = %lu, CO SSN = %lu\nPhone =
%lu, Address = %s, Income = %8.2f\nCredit Limit = %7.2f\n",applicant->Name,applicant->co_app_name,applicant->ssn,applicant->co_app_ssn,applicant->phone,applicant->adress,applicant->total_income_annual,applicant->credit);
}
Which would leave the following on their monitors
if you were to ever call in for a credit inquiry or increase:
And with even more tweaking they could have a
screen that gives available credit, credit score, how often payments
are made, how much is normally paid, and many other tools that could
mean the difference of more credit or canceling a card.
Now this is just one VERY simple use of an array
of structure, the point is they are everywhere and weather we
realize it or not our lives in many ways are effected by them, and
the list above of how they are being used is just a couple there is
feasibly thousands and thousands of ways they can be used.
Addition web sights:
the following sites have some good additional
information
http://etnus.com/ In this site go to total view and c/c++
support
http://www.cs.buffalo.edu/faculty/bina/cs1/cs1/lec7/sld001.htm
This sight has a slide presentation (class lecture) on arrays.
www.cs.utexas.edu/users/rpriebe/cs302_032/Lectures/15-Java.ppt
This sight is a powerpoint slide presentation
(class lecture) on arrays