Jump to content
The simFlight Network Forums


Recommended Posts

FSUIPC_Write(DWORD dwOffset, DWORD dwSize, void *pSrce, DWORD *pdwResult);

how can i use the "void *pSrce"?

It's the pointer to the data you want to write. It is defined as a "void pointer" so that you can use any data type -- a string pointer for a string of characters, or whatever.

Are you just learning C? Programming things to interface to FS is not a good starting project if you are just beginning.



Link to comment
Share on other sites

Are you just learning C?

No, i'm not new to C but i've never saw a void pointer, only void methods!!!!.

Thank you for the answer!!!


Just pull up your Kerninghan & Ritchie... should be in there. A void * is a pointer that could be made to point to ANY data type. Meaning the same variable coud be made to point to a character first (e.g. string), next to an int and even later to some struct containing data. But not simultaneously of course.

You probably shouldn't declare some variable as a void * unles you really don't know what's going to end up in it in the first place. It's a common way of transferring blocks of data of any type (e.g. "raw bits") from one place to another. Later in the code will be decided what data it actually is (or, if you're writing a dumb copy, for example, you don't want to care about the data type and output a void * as well).

The reason you see voids in front of a function a lot is because you don't want every function to return a value. In the case of a void function it will return a variable of no data type, e.g. no return value. You can make a function void * to let it return a raw memory address.

Just to let you know: Pointers are pretty messy, and don't fiddle with them too much or you'll cause defintite memory leaks or hard crashes. C doesn't have a way of checking whether an application stays within its own memory space (C++, however, does have a mechanism and raises an EAccessViolation if you 'step out of bounds'.)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.