17th Aug 2018, 3:28 PM
salah
4 odpowiedzi
+ 1
WriteLine, not Writeline. Also ReadKey, not Readkey. Also you should to get access members of struct car via object name not via class name. Corrected code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { //you should access modifier public //to get access members of car struct car { public String name; public String company; public int dollar; } static void Main(string[] args) { car ray; Console.WriteLine("the car is"); ray.name = Console.ReadLine(); Console.WriteLine("the company is"); ray.company = Console.ReadLine(); Console.WriteLine("the coust is"); ray.dollar = Convert.ToInt32(Console.ReadLine()); //Console.ReadKey(); not working in SoloLearn } } }
17th Aug 2018, 3:38 PM
Roman Khristoforov
Roman Khristoforov - avatar
0
it isn't work too
18th Aug 2018, 10:03 AM
salah
0
what do you mean? you are not able to compile ?
18th Aug 2018, 10:09 AM
Roman Khristoforov
Roman Khristoforov - avatar
0
l copy your code it's work
18th Aug 2018, 11:37 AM
salah