C# Lists 📃

preview_player
Показать описание
C# lists tutorial example explained

#C# #list #tutorial

// List = data structure that represents a list of objects that can be accessed by index.
// Similar to array, but can dynamically increase/decrease in size
// using System.Collections.Generic;
Рекомендации по теме
Комментарии
Автор

using System;
using System.Collections.Generic;

namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{

// List = data structure that represents a list of objects that can be accessed by index.
// Similar to array, but can dynamically increase/decrease in size
// using System.Collections.Generic;

List<String> food = new List<String>();

food.Add("pizza");
food.Add("hamburger");
food.Add("hotdog");
food.Add("fries");






//food.Remove("fries");
//food.Insert(0, "sushi");




//food.Sort();
//food.Reverse();
//food.Clear();
//String[] foodArray = food.ToArray();

foreach (String item in food)
{
Console.WriteLine(item);
}

Console.ReadKey();
}
}
}

BroCodez
Автор

Dude you're a life saver im not joking.

Eh-man
Автор

"Those who stand at the top determine what's wrong and what's right! This very place is neutral ground! Justice will prevail, you say? But of course it will! Whoever wins this war becomes justice!"
~ Don Quixote Doflamingo

huseyncfrov
Автор

This list method can be used to make a todo list, right?

heymide
Автор

How do I get the average value? I want to use the
Variable.Average(); Command and then assign this average to another variable to display.

Blane
Автор

Is there any benefit to this over doing something like:
string[] food = new string[] { "pizza", "hamburger", "hotdog", "fries"};
and then using '(0, food.Length);', which seems to circumvent the need to declare a definite array size?

IndustrialBonecraft
Автор

sdfsadfasdfasdfasd

great tutorial! i was looking for alternatives to array, thanks!

PedroL.Rosario
Автор

yeah but how do you get one of the elements out of the list??

gaminggoddessaria
Автор

import random
print(random.randint(1, four twenty sixty nine))

akshaysathyanath
visit shbcf.ru