im using visual studio and have ongoing school project so bare with me as im a newbie at this language.
basically a console for hamburger program where ucan search and add but for some reason its giving me error on public static list<HamList> saying list not found :S
Code:using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace SuperSizeMe
{
public class HamList
{
public HamList(string Namn, string Drycka, string Pommes, int kostnad)
{
this.Namn = Namn;
this.Drycka = Drycka;
this.genre = Pommes;
this.kostnad = kostnad;
}
}
public class Program
{
public static list<HamList> skiva = new list<HamList>();
public static void Main(string[] args)
{
MainMenu();
taListan();
Console.ReadLine();
StreamWriter utfil = new StreamWriter("lager.txt");
list.ForEach(delegate(taListan k)
{ utfil.WriteLine(k.Namn + utfil.NewLine + k.Drycka + utfil.Pommes + k.kostnad); });
utfil.Close();
}
public static void MainMenu()
{
int funktion;
Console.WriteLine("\n main menu");
Console.WriteLine(" 1. söka hamburgare");
Console.WriteLine(" 2. lista alla hamburgare ut");
Console.WriteLine(" 3. mata in nya hamburgare");
Console.WriteLine(" 4. ta mig härifrån");
Console.Write(" Ditt val---> ");
while (!int.TryParse(Console.ReadLine(), out funktion) || funktion < 0 || funktion > 3)
{
Console.WriteLine(" obs!... se upp funktioner och försök igen");
Console.Write(" Ditt val---> ");
}
Console.Clear();
Console.ReadLine();
if(funktion == 1)
{
sök();
}
else if (funktion == 2)
{
listaUt();
}
}
public static void sök()
{
}
public static void listaUt()
{
}
}
}
It should be:
public static List<HamList> skiva = new List<HamList>();
not:
public static list<HamList> skiva = new list<HamList>();
what is your native language !
as said before its
Say how did you get the code to syntax highlighted !Code:public static List <HamList> Skiva = new List<HamList> ( );![]()
He used the [PHP] and [/PHP] tags and th language is Swedish![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks