Now I figure out why previous post don't work. struct GAME : public MAP, public PIKA { void t(char c){ PIKA::turning_side = c; } void test() { PIKA::testi(); } }; void main(){ GAME game; game.t('L'); } Turns out that Creating new parent GAME creates also new child PIKA, and this is separate from main loop. It means that I can't use separately in main PIKA, full it with data and then use in GAME, but I need initiate GAME, and from GAME level initiate all values of PIKA.
I try use it, but I have error. struct PIKA{ int x; int y; char turning_side; pair pos; void update_pos(int _x, int _y){ x = _x; y = _y; } void update_pos(pair _pos){ x = _pos.first; y = _pos.second; } void update_side(char _c){ turning_side = _c; // this line get char ' L ' } void testi(){ cerr
This tutorial rules. I was having trouble with my homework and this helped me so much because I was having issues with ambiguity.
Thanks for the kind words! I'm glad you were able to get some use out of it!
Now I figure out why previous post don't work.
struct GAME : public MAP, public PIKA {
void t(char c){
PIKA::turning_side = c;
}
void test() {
PIKA::testi();
}
};
void main(){
GAME game;
game.t('L');
}
Turns out that Creating new parent GAME creates also new child PIKA, and this is separate from main loop. It means that I can't use separately in main PIKA, full it with data and then use in GAME, but I need initiate GAME, and from GAME level initiate all values of PIKA.
Thanks!
You have left some int in the float class though)
Thanks, that helped.
You're welcome! Thanks for the comment!
I try use it, but I have error.
struct PIKA{
int x;
int y;
char turning_side;
pair pos;
void update_pos(int _x, int _y){
x = _x;
y = _y;
}
void update_pos(pair _pos){
x = _pos.first;
y = _pos.second;
}
void update_side(char _c){
turning_side = _c; // this line get char ' L '
}
void testi(){
cerr