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.

iOS Object-Oriented Swift Complex Data Structures Declaring a Struct

NAVEED CHOWDHURY
NAVEED CHOWDHURY
1,142 Points

Struct Task

What am I doing wrong, I am getting errors

objects.swift
struct User {

    let name: String
    let age: Int

}
 Enter your code below

Hello:

It should work the way you have it.. I am not sure why it would give you errors.. Try doing it below where it says " Enter your code below ".

Looks like you have everything correct as far as code.

2 Answers

Jeff McDivitt
Jeff McDivitt
23,970 Points

What errors are you receiving as your code is correct?

struct User {

let name: String
let age: Int

}
NAVEED CHOWDHURY
NAVEED CHOWDHURY
1,142 Points

Thanks a lot guys it works now , I think I deleted the line "Enter your code below" , thats why it was not working .