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

Donghyeok Yun
Donghyeok Yun
4,514 Points

Declare a string variable named bookTitle. (Don’t assign it anything.) ??? (confused)

So, I was confused on this because I put string bookTitle = ; as the answer but it's not working. I'm stuck. Thank you.

CodeChallenge.cs
string bookTitle = ;

2 Answers

Billy Bellchambers
Billy Bellchambers
21,689 Points

Your very close with this one.

The challenge specifically asks not to assign anything to it therefore there is no need to add the equals sign at all only declare the variable.

string bookTitle;

This will give you the result you need

Kris Byrum
Kris Byrum
32,636 Points

This also translates to other programming languages.

Essentially this sets the value to NULL or undefined (language dependent).

If it's an array or object that you need, I will usually equate it to an empty [] or {} so that I know the variable's type.

In this instance, string bookTitle; is the correct one.