Solved

C# basics

Posted on 2006-11-20
1
207 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 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

23 Experts available now in Live!

Get 1:1 Help Now