HELP WITH C++ S0beit

Creak

Member
Joined
Nov 21, 2021
Messages
5
Reaction score
0
Location
China
PHP:
static int menu_callback_newcheats(int op, struct menu_item *item)
{
    switch (op)
    {
    case MENU_OP_ENABLED:
        switch (item->id)
        {
        case ID_NEWCHEAT_FLOODER:
            return cheat_state->_generic.FLOODER;

        }
        break;

    case MENU_OP_SELECT:
        switch (item->id)
        {
        case ID_NEWCHEAT_FLOODER:
            cheat_state->_generic.FLOODER ^= 1;
            break;
        }
    }
    return 0;
}

When compile it, four errors come out
Code:
C2039 "Flooder" : Not a member of "cheat_state_generic"
class "cheat_state_generic" doesn't have a member about "Flooder"
C2039 "Flooder" : Not a member of "cheat_state_generic"
class "cheat_state_generic" doesn't have a member about "Flooder"

How to work out
 

SobFoX

Expert
Joined
Jul 14, 2015
Messages
1,391
Solutions
4
Reaction score
894
Location
Israel
I recommend you learn a little about what a "programming language" is and learn a little about C ++. There are lots of great tutorials in every language.
 

0x_

Wtf I'm not new....
Administrator
Joined
Feb 18, 2013
Messages
1,118
Reaction score
166
True, instead of taking 4bits in memory you only use one single bit, saving you unnecessary clutter once the project is large
How's a 32bit integer 4bits? and since when is a bool 1bit? hope you meant byte nevertheless I'm kinda confused.
If you want to save memory needlessly you could use a bitfield which allows you to store 8x 0/1 states in 1 byte. But all this is probably out of thread author's range of experience in this particular moment so please, at least explain it the right way.
 

SobFoX

Expert
Joined
Jul 14, 2015
Messages
1,391
Solutions
4
Reaction score
894
Location
Israel
How's a 32bit integer 4bits? and since when is a bool 1bit? hope you meant byte nevertheless I'm kinda confused.
If you want to save memory needlessly you could use a bitfield which allows you to store 8x 0/1 states in 1 byte. But all this is probably out of thread author's range of experience in this particular moment so please, at least explain it the right way.
Very true but here just needed a simple bool
Although he would use byte then he would do any modi for his flood: P
 
Top