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 trialPema Khando Shachentsang
Courses Plus Student 1,210 PointsObject oriented
let Value: (name : String, age : String) = (0,0) Value Struct User { let name: String let age: String } let User = User (x: 0, y:0)
// Enter your code below
let Value: (name : String, age : String) = (0,0)
Value
Struct User {
let name: String
let age: String
}
let User = User (x: 0, y:0)
1 Answer
Joshua Hawthorne
18,523 PointsHi Pema,
I'm not sure exactly what you're trying to do, but I'll show you the proper syntax below. Compare the capitalization in your code compared to mine. Remember to use camelCase when creating constants (let) and variables (var), and to capitalize structs and classes.
struct User {
let name: String
let age: String
}
let user = User(name: "yourName", age: 29)
let value: User = User(name: "anotherName", age: 23)
Kieran Black
9,139 PointsKieran Black
9,139 PointsHi Pema,
Your Struct definition is case sensitive and should be lower case, also you should double check your age constant type within the User struct.
Hope that helps you get on your way :)