Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Needed help with this question. (CodeChallange)
Someone, please help me with this! the question says: Convert the string in heightInput to an integer using int.Parse. Store the result in a variable named height. I tried everything and I could not get it to work..
string heightInput = "168"; string height = heightInput; int.Parse(heightInput);
Jennifer NordellTreehouse Teacher
Hi there, Ibrahim! There are a couple of things going on here. First, we're trying to turn that string into an integer and then store the integer version of it in the variable
height, but you've declared
height to be of type
string. Secondly, you do use the
int.Parse method, but the result of that is neither displayed nor saved anywhere. It's just sort of floating out there in limbo.
Steps to take:
heightto be type int
heightto be equal to the result of running
I think you can get it with these hints, but let me know if you're still stuck!