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 trialMichael Brown
17,651 PointsCan Anybody tell me what I am doing wrong here?
I am pretty sure I have done what the challenge has asked, at least the first part, but it keeps telling me I am missing some structs?
Here is my code: using System; using System.Collections.Generic; using System.Linq; using System.Web;
namespace Treehouse.Models { public class VideoGame { public int Id {get; set;} public string Title {get; set;} public string Description {get; set;} public string Characters[] {get; set;} public string Publisher {get; set;} } }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Treehouse.Models
{
public class VideoGame
{
public int Id {get; set;}
public string Title {get; set;}
public string Description {get; set;}
public string Characters[] {get; set;}
public string Publisher {get; set;}
}
}
1 Answer
Dane Parchment
Treehouse Moderator 11,077 PointsRecall your variable typesetting skills, when you create a new variable with an array type, how do you call it?
Like so: type [] variableName
.
Look carefully at your code, where do you create you array type, and do you notice anything wrong with it?
If you cannot figure it out, then your solution is:
changing public string Characters[] {get; set;}
to public string [] Characters {get; set;}