CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    Passing Class Array as pointer to function

    What is the best way to pass an instance of a class myclass[7] to a function as an arguement?


  2. #2
    Join Date
    Apr 1999
    Posts
    90

    Re: Passing Class Array as pointer to function

    One way:

    void YourFunction(myclass myClassArray[], int nElements);



  3. #3
    Guest

    Re: Passing Class Array as pointer to function

    Example:

    void MyFunction( CMyDialog *pDialog )
    {
    //function body
    }

    ...

    void CSomeWhere::Something()
    {
    CMyDialog MyDialog[10];

    //Pass a class pointer to our function
    MyFunction( &MyDialog[7] );
    }







Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured