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.

C# C# Basics (Retired) Perform Converting Strings to Integers

Angus Eliott
Angus Eliott
3,793 Points

code problem

my code appears to be correct but the code challenge returns the error " Bummer! Did you pass heightInput to int.Parse?"

CodeChallenge.cs
int height;
int.Parse heightInput = height;

1 Answer

Antonio De Rose
Antonio De Rose
20,878 Points
int height;
int.Parse heightInput = height;

//break down the problem, you've been asked to convert heightInput into int and store it into height
//you are case, you have declared height, then assigning the height, which is of no value to
//heightInput, then again which does have errors.

//by the way, you should not, in general modify questions. Does seem like, you have modified
//I would advise you to restart the quiz, once again and have a try.

//hint - you have to assign it to the height, what you have to assign is the heightInput,
//which needs conversion(converting into int), 


//string heightInput = "168";
//int ?????? = ????????;