#### Archived

This topic is now archived and is closed to further replies.

# help with keystate in DirectInput

This topic is 5723 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

in the book TOTWGPG, Andre used this: typedef _DIKEYSTATE UCHAR[256]; _DIKEYSTATE keystate[256]; but when I try to compile it, I get this error: error C2146: syntax error : missing '';'' before identifier ''UCHAR'' so I was wondering what is wrong with this code? Thanks for taking time to help me ______________________________________________ You know your game is in trouble when your AI says, in a calm, soothing voice, "I''m afraid I can''t let you do that, Dave"

##### Share on other sites
Hmm.. Why not just

UCHAR keystate[256];

##### Share on other sites
Yeah, I opened the source file for the program that Andre programmed, and there isn''t a miserable typedef _DIKEYSTATE UCHAR[256];

He just uses UCHAR keystate[256] without telling the reader to... stupid.

______________________________________________
You know your game is in trouble when your AI says, in a calm, soothing voice, "I''m afraid I can''t let you do that, Dave"

##### Share on other sites
BTW, your typedef have been wrote in reverse.

// WRONG XXtypedef _DIKEYSTATE UCHAR [256];// GOOD !!typedef UCHAR _DIKEYSTATE [256];

• 11
• 16
• 11
• 13
• 11