Solved

C# basics

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

763 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