cfrank2000
Well-known member
- Joined
- Mar 6, 2021
- Messages
- 71
- Programming Experience
- Beginner
Hi
my name is frank struggling with record type arrays/lists (pascal programing analogies). I am trying to build kind of record type array or list but as a beginner I don't understand how does it work, specially accessing it by reline or by row, work with it, display it. I was thinking about data table option also but I need help with this matter. I am posting my instance below, please help me thank you, frank
my name is frank struggling with record type arrays/lists (pascal programing analogies). I am trying to build kind of record type array or list but as a beginner I don't understand how does it work, specially accessing it by reline or by row, work with it, display it. I was thinking about data table option also but I need help with this matter. I am posting my instance below, please help me thank you, frank
ConsoleApp2listtyplist1:
using System;
using System.Collections.Generic;
using System.Collections;
namespace ConsoleApp2listtyplist1
{
class Program
{
static void Main(string[] args)
{
// Collection of string
string[] animals = { "bird 1", "bird 1", "bird 1" };
string[] animals2 = { "bird 12", "bird 12", "bird 12" };
string[] animals3 = { "bird 13", "bird 13", "bird 13" };
// Create a List and add a collection
List<string> animalsList = new List<string>();
animalsList.AddRange(animals);
animalsList.AddRange(animals2);
animalsList.AddRange(animals3);
foreach (string a in animalsList)
Console.WriteLine(a);
ArrayList a1 = new ArrayList();
a1.Add(1);
a1.Add("Example");
a1.Add(true);
Console.WriteLine(a1[0]);
Console.WriteLine(a1[1]);
Console.WriteLine(a1[2]);
Console.ReadKey();
Console.WriteLine("Hello World!");
List<string> array1 = new List<string>();
array1.Add("test");
List<List<string>> array2 = new List<List<string>>();
array2.Add(array1);
List<ArrayList> alsList = new List<ArrayList>();
}
}
}