Solved

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

Posted on 2006-06-21
2
701 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 250 total points
ID: 16953466
Private, Public: replace with private, public.
0
 
LVL 35

Assisted Solution

by:mrichmon
mrichmon earned 250 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Change to event 1 72
import issue in bit values 3 44
XML to SQL Table using c# 5 44
dynamic menu in asp.net c# 11 26
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now