?
Solved

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

Posted on 2006-06-21
2
Medium Priority
?
734 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

752 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