At 08:44 2007-02-25, duongthaiha wrote:
>Hi
>
>I am trying to pass a object by reference with pointer

why not a reference?

>  into a function
>and using a method in that object. By seem to me it doesn't work.
>
>The object i want to pass is Game and in Game have a function vector
><char> getPuzzle ();
>
>I pass game into the function
>
>bool guess (Game* game){
>//do something here
>
>vector <char> p = game->getPuzzle();
>//do something here too
>}
>
>it will compile but when i run it it come back with the error message
>
>This application has requested the Runtime to terminate it in an
>unusual way.
>Please contact the application's support team for more information.
>
>Can you please tell me is that the correct way of using it? What
>should i do to avoid this kind of error
>I am quite new to C++ so please forgive me if the question is not
>appropriate.

there is nothing obvious wrong with the code you showed (but I'd use 
a reference not a pointer).
I'd suggest using your debugger and stepping through the code.

>Thanks a lot
>
>
>
>
>To unsubscribe, send a blank message to 
><mailto:[EMAIL PROTECTED]>.
>Yahoo! Groups Links
>
>
>

Victor A. Wagner Jr.      http://rudbek.com
The five most dangerous words in the English language:
               "There oughta be a law" 

Reply via email to