Hi
I am trying to pass a object by reference with pointer 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.
Thanks a lot

Can you please help me
dustinto
it's hard to tell what's wrong with your code since it appears correct and maybe it's not this sample that's causing the problem. Did you use the debugger to check where the error is
Are you passing a valid object to this function guess
It could be a lot of things, you better post your complete code (or reduce the sample to a simple case if your code is to big to post) somewhere so we can help you better.
rWarrior
Phil Rogers
dvdribeiro
bw12117
That probably means that the Game pointer you are passing isn't initialized properly.
Make sure your application resembles: