Was wondering how to get this code to print my name after the input of it. I get an error message after the input. http://www.sololearn.com/app/csharp/playground/cGKtkKCiph1T/ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Was wondering how to get this code to print my name after the input of it. I get an error message after the input. http://www.sololearn.com/app/csharp/playground/cGKtkKCiph1T/

29th Jul 2016, 7:58 PM
Daniel Hildreth
Daniel Hildreth - avatar
2 Answers
+ 8
Hi Daniel Was just a little problem in the readline, follow: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn {     class Program     {         class Person         {             private string name;             public string Name             {                 get { return name; }                 set { name = value; }             }         }         static void Main(string[] args)         {             Person p = new Person();             Console.WriteLine("What is your name?");             p.Name = Console.ReadLine();             Console.WriteLine(p.Name);         }     } } If you want upvote my answer please.
29th Jul 2016, 10:44 PM
Ricardo Pucca
Ricardo Pucca - avatar
0
Thanks Ricardo.
29th Jul 2016, 10:52 PM
Daniel Hildreth
Daniel Hildreth - avatar