?
Solved

Unsure how to handle Invalid token 'int' in class, struct, or interface member declaration error

Posted on 2006-06-21
2
Medium Priority
?
752 Views
Last Modified: 2007-11-27
I am extremely new to C# and I get the following error with int highlighted at every line item:

Invalid token 'int' in class, struct, or interface member declaration

How do I fix the syntax below to work properly?
The following was taken from Sams Teach Yourself Microsoft Visual C#.NET 2003 in 24 hours on page 352.
Also - I hate the way my IDE in 2003 keeps trying to tab the braces once I press <ENTER> on a line item - it is not helping to much as I type in these examples.  Any suggestions is much appreciated - Stephen

using System;

namespace Class_Programming_Example
{
      /// <summary>
      /// Summary description for clsMyClass.
      /// </summary>
      public class clsMyClass
      {
      Private int m_intHeight;

      Public int Height
            {
                  get
                  {
                        return m_intHeight;
                  }
                  set
                  {  
                        m_intHeight = value;
                  }
            }
            public clsMyClass()
            {
            
                  //
                  // TODO: Add constructor logic here
                  //
            }
      }
}
0
Comment
Question by:stephenlecomptejr
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 1000 total points
ID: 16953466
Private, Public: replace with private, public.
0
 
LVL 35

Assisted Solution

by:mrichmon
mrichmon earned 1000 total points
ID: 16954839
Remember that C# is case sensitive.  Almost all keywords begin lowercase.


As for the braces issue...you need to adjust your options.

Tools --> options --> TextEditor --> C# --> Formatting

You may want to uncheck options under indenting.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month16 days, 7 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question