מבנה נתונים ב- c#
ניסיתי להשתמש בפונקציה כדי להדפיס את המיד בstruct ולא הצלחתי. איך עושים זאת? אשמח לטיפים
ניסיתי להשתמש בפונקציה כדי להדפיס את המיד בstruct ולא הצלחתי. איך עושים זאת? אשמח לטיפים
sing System; using System.Collections.Generic; using System.Text; namespace @struct.personaldetails { struct address { public string street, town; public int no; } struct person { public string lname, fname; public address adr; } class Program { static void Main(string[] args) { address a; a.street = "professor shor"; a.town = "Holon"; a.no = 6; person p; p.lname = "Levy"; p.fname = "Ifat"; p.adr = a; PrintDetails (p); } public void PrintDetails (person p) { Console.WriteLine("person details:\n {0}\n {1}\n {2}\n {3}\n {4}\n", p.lname, p.fname, p.adr.street, p.adr.town, p.adr.no); } } }