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 trialJahmai Jones
1,741 PointsDid you declare the `height` variable as an int?
not sure what is wrong here
string heightInput = "168";
string height = int.Parse 168;
Daniel Bell
17,178 PointsYou have declared 'height' variable as a string. int.Parse() is a function that accepts a string as an argument and returns an integer.
I recommend reviewing the previous few videos again.
1 Answer
Steven Parker
231,248 PointsThe variable is being declared as the wrong type:
string height = int.Parse 168;
//^^^^
//should be "int" instead
Jahmai Jones
1,741 PointsJahmai Jones
1,741 PointsNevermind i have solved it.
string heightInput = "168";
int height = int.Parse(heightInput);
Just needed to put the variable name instead