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

Threaded View

  1. #1
    Join Date
    May 2006
    Posts
    306

    [RESOLVED] Class Pointer?

    Can I set a variable to be a pointer/reference to a class?

    PHP Code:
    <?php
        
    class Data {}
        
    $DataClass Data;
        
    $Data1 = new $DataClass;
    ?>
    I'm not so good with pointer syntax, is it &?

    Also, it's for something like this.

    PHP Code:
    <?php
        
    class A
        
    {
            public 
    $B;
            function 
    __construct()
            {
                
    $this->= &A_B;
            }
        }
        
        class 
    A_B
        
    {
            
        }
        
        
    $A = new A();
        
    $B = new $A->B();
    ?>
    Last edited by code?; July 8th, 2009 at 12:58 PM.

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