Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Another C related comment

Author
Message
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 5th Jul 2003 17:32
Whilst porting some C code I keep encountering pointers being passed to functions as arguments. For example:



I have decided to have a stab at replicating this code in DBP as follows:



I'm not sure I can use the * in quite this way in DBP but we shall see if it works or not! LOL.

Cheers

Phil
Coming up... a hell of a 3D Space Trading Game!
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 5th Jul 2003 18:23
That wont work - what you need to do is pass the memory address, and the use either mine or IanM's peek/poke routines to get the data out of the memory address. If you dont want to do that, you can do something like :

value=*addr

and then increase addr by 1,2/4 bytes etc

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins and other exciting things - oh my, yes!
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 5th Jul 2003 19:11
Ok! Thanks. I'm going to try the variable = pointer method first and then if that fails, I'll try and use your peek/poke routines.

Phil

Coming up... a hell of a 3D Space Trading Game!

Login to post a reply

Server time is: 2024-11-24 20:41:48
Your offset time is: 2024-11-24 20:41:48