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
Solved

C# basics

Posted on 2006-11-20
1
211 Views
Last Modified: 2010-04-16
using System;
using System.Collections;
namespace XMLTesting
{
      class Class1
      {
            
            private ArrayList alCardUpdateAcks=new ArrayList();
            static void Main(string[] args)
            {
                  public void AckMsg(ArrayList pCardUpdAcks)
                  {
                        alCardUpdateAcks = pCardUpdAcks;
                  }

            }
      }       
}

How can i make the above code compile free?. Because it is showing error in braces {,
even though it is proper.
0
Comment
Question by:Rahamathulla_J
1 Comment
 
LVL 9

Accepted Solution

by:
daniel_balla earned 250 total points
ID: 17985526
Hi Rahamathulla_J,
> using System;
> using System.Collections;
> namespace XMLTesting
> {
>      class Class1
>      {

>           private ArrayList alCardUpdateAcks=new ArrayList();
>           static void Main(string[] args)
>           {
>                public void AckMsg(ArrayList pCardUpdAcks)
>                {
>                     alCardUpdateAcks = pCardUpdAcks;
>                }

>           }
>      }      
> }
Hi
I am afraid it is not proper. you cannot have a function within a function so you would need to change it to:

using System;
using System.Collections;
namespace XMLTesting
{
     class Class1
     {
         
          private ArrayList alCardUpdateAcks=new ArrayList();
          static void Main(string[] args)
          {
              // Eventually callthe method here
              AckMsg(alCardUpdateAcks);
          }

         public void AckMsg(ArrayList pCardUpdAcks)
         {
             alCardUpdateAcks = pCardUpdAcks;
         }
     }      
}

Cheers!
Dani
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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

856 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