Why does this fail?

Discussion in 'C++' started by JoeC, May 8, 2006.

  1. JoeC

    JoeC Guest

    class player{

    string name;
    graphic * gr;
    void create();

    public:
    player();
    graphic& gOut() {return *gr;} <- Wand to retrun the graphic for
    display
    void dummy(){MessageBox(NULL, "Dummy" , "Notice", MB_OK); }
    };

    graphic& space::graphicOut(){

    if(play){return play->gOut();} <-Returning the graphics pointer
    for display
    if(seen){return *gr;}
    else {return *grDefault;}
    }

    graphic& board::display(int y, int x){
    return spaces[y][x].graphicOut();
    }

    gr = &maze->display(l2, l1);
    gr->display(hwnd, l1*spacing, l2*spacing); <-crashes here
    when I try to display the
    graphic from the player.
     
    JoeC, May 8, 2006
    #1
    1. Advertising

  2. JoeC

    JoeC Guest

    I can't seem to get the pointer accross.
     
    JoeC, May 8, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fred
    Replies:
    0
    Views:
    620
  2. Jim West
    Replies:
    5
    Views:
    615
    Jim West
    Oct 14, 2003
  3. Wenjie

    if (f() != FAIL) or if (FAIL != f())?

    Wenjie, Jul 28, 2003, in forum: C Programming
    Replies:
    3
    Views:
    483
    E. Robert Tisdale
    Jul 31, 2003
  4. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    992
    Mark Rae
    Dec 21, 2006
  5. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,263
    Smokey Grindel
    Dec 2, 2006
Loading...

Share This Page