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 Console I/O

Getting an error in Console I/0

So trying to figure out how to debug this line of code.

CODE: string bookTitle = System.Console.Readline(bookTitle);

something to do with System.Console.Readline()

CodeChallenge.cs
System.Console.Write("Enter a book title: ");
string bookTitle = System.Console.Readline(bookTitle);

Sorry, new to Treehouse!

1 Answer

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

Hi there, Michael Craig ! I received your request for assistance. You're definitely on the right track. The error you're receiving is that there is no definition for the Readline method. And it's correct. There is however, a definition for the ReadLine method. Note the capitalization on the "L". Assume going forward that literally everything in programming will be case-sensitive. When you fix that, you will still have an error because the ReadLine() method takes no arguments. This means that the parentheses should be empty.

You wrote:

string bookTitle = System.Console.Readline(bookTitle);

But that should be:

string bookTitle = System.Console.ReadLine();

Hope this helps! :sparkles:

Thank you so much! This helped a lot and I was getting stressed. Thanks again and have a good day/afternoon/evening!