Slimelite BBS

Watcom C++ 10.5

Back to EMULATE

From Sean Palmer · 1996-04-10 22:55 · #73586 in EMULATE

JS>Hi, I just got Watcom C++ and was trying to compile some code for a dos
JS>game.  I keep getting errors that the compiler says is undefined
JS>symbols.  The symbols are "peek" and "peekb".  I looked in the help
JS>files and looked through some header files, but couldn't find these
JS>commands.  Does anyone know where they are or any commands that
JS>substitute these two commands?  Thanks.

It sounds like absolute memory references. Try typecasting a constant 
hex long into a pointer type and storing through it.

Something like this:

inline long peek(unsigned long addr) { return *(long*)addr; }
inline char peekb(unsigned long addr) { return *(char*)addr; }


---
 * WR 1.32 # 380 * Programmer - an organism that turns coffee into software
 * Origin: deltaComm Online (919) 481-9399 (1:151/107)