× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I looked at that and couldn't make sense for a while. Then I realized that he wasn't "passing a pointer; it only _looks_ like he's passing a pointer because that's how he declared it. He's actually passing the _address_ of the pointer which he's set to be the same as the address that was originally passed in.

You're right, of course. That explains why his version worked. He had his InVar pointer overlaying the same memory as InFmt (actually, he didn't show the code that did that -- but now that you bring it up...)

Granted, doing that is a completely confusing and non-sensical thing to do -- if InVar overlays memory containing '*DTS' it won't be a valid pointer value -- and therefore is completely useless as a pointer, but since the address is all that gets passed to the API anyway, if InVarPtr is set to the address of InFmt, it WOULD work.

There's absolutely no practical reason to do that, of course. (Aside from code obfuscation, I suppose.)

I'd really like to understand the rationale behind writing the code that way to begin with. Was it just random trial and error until something worked? Why would you ever do that? What was the thought process behind it?

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.