Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialjack Sandberg
1,659 PointsI don't understand what im doing wrong?
I have no ide what im doing wrong and the compiler doesn't help ...
string firstName = Console.ReadLine(firstName);
Console.WriteLine(firstName);
3 Answers
Jeremy Hill
29,567 Pointsit should look like this:
string firstName = Console.ReadLine();
Steven Parker
231,248 PointsOn your top line, you have two issues:
- you can't use a variable (firstName) before it has been declared and assigned.
- the function Console.ReadLine() doesn't take an argument.
Of course, fixing the second one will also make the first issue go away.
Jeremy Hill
29,567 PointsJust remove the firstName variable out of the Console.ReadLine(); it shouldn't be in there.