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 trial

C# C# Basics (Retired) Console I/O Formatting Output

Did you forget to pass `firstName` to `WriteLine` as a parameter?

string firstName = Console.ReadLine(); Console.WriteLine( + firstName + "rocks!" );

On the above piece of code I keep on getting the error mentioned in title. Kindly help!

CodeChallenge.cs
string firstName = Console.ReadLine();
Console.WriteLine( + firstName + "rocks!" );

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! In your Console.WriteLine() you have an unnecessary + before the firstName variable which is causing a compiler error. At this point, your code can no longer be compiled. Remember a + sign is used either to add two numbers together or add two strings together, but there is nothing preceding that plus sign.

Also, while this does not affect the challenge at all, you did not include a space before "rocks!". If I put in "Ashish", your code would print out Ashichrocks! instead of Ashish rocks!.

Hope this helps! :sparkles: