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 trial

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
Jhoan Arango
Jhoan Arango
14,575 Points

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 ".

Alphonso Sensley II
Alphonso Sensley II
8,514 Points

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 .