` Memcpy to get a value from an address (Paul Attryde) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Clarion in general: Memcpy to get a value from an address
2004-03-11 -- Paul Attryde
 
Newsgroups: softvelocity.clarion.language > I am calling a function that returns that address of a memory location. > How do I get the contents of that location when all I have is the address? So you're doing something (making an API call for example) and getting back a pointer? But because CW doesn't support pointers you can't dereference it? There's a couple of ways to do it. You can do what Bernie suggested and use a reference variable (but that assumes you're using a version of CW that supports reference variables, and this is softvelocity.clarion.language, not softvelocity.public.clarion6) Personally I use memcpy, only because I've been doing this for a while and CW2 didn't have reference variables :) http://www.attryde.com/clarion/cw_prototypes.htm, #8 ISTR Randy Goodhew saying you can do it using PEEK as well, but I've never used that. You may have to search the NGs for more info. -- Paul


Today is April 26, 2024, 7:58 am
This article has been viewed 35113 times.
Google search has resulted in 116 hits on this article since January 25, 2004.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: