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

Posted on 2006-06-21
Medium Priority
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
                        return m_intHeight;
                        m_intHeight = value;
            public clsMyClass()
                  // TODO: Add constructor logic here
Question by:stephenlecomptejr
LVL 48

Accepted Solution

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

Assisted Solution

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.

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
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…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Through the video, you can check the migration process of Outlook PST file to PDF. Kernel for Outlook to PDF tool can convert Outlook emails with all attributes like Subject, To, From, Cc, Bcc and other folders such as Inbox, Outbox, Sent Items, Jun…
Suggested Courses

597 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