INTRODUCTION:-
An array is a technique of storing information of different items in a common variable of one name.
CODING EXAMPLE:-
This type of list can be created using a string-based array. Here is an example:
private void Form1_Load(object sender, System.EventArgs e)
{
string[] lstItemsNames = { "Women Coat", "Men Jacket", "Teen Jeans",
"Children Playground Dress" };
}
{
string[] lstItemsNames = { "Women Coat", "Men Jacket", "Teen Jeans",
"Children Playground Dress" };
}
The above type of list is referred to as a single-dimensional. To provide more information about items, you can associate a second or even a third list to the first as follows:private void Form1_Load(object sender, System.EventArgs e)
{
string[] itemsNumbers = { "624376", "274952", "749752", "394085" };
string[] lstItemsNames = { "Women Coat", "Men Jacket", "Teen Jeans",
"Children Playground Dress" };
double[] itemsPrices = { 225.55, 175.75, 24.50, 75.05 };
}
{
string[] itemsNumbers = { "624376", "274952", "749752", "394085" };
string[] lstItemsNames = { "Women Coat", "Men Jacket", "Teen Jeans",
"Children Playground Dress" };
double[] itemsPrices = { 225.55, 175.75, 24.50, 75.05 };
}
No comments:
Post a Comment