Re: I swear the Germans are mocking me... C_STRUCT aiMeshAnim** mMeshChannels (what?)

new topic     » goto parent     » topic index » view thread      » older message » newer message
ssallen said...

So if the aiMeshAnim struct looks like this:

struct aiMeshAnim 
{ 
        /** Name of the mesh to be animated. An empty string is not allowed, 
         *  animated meshes need to be named (not necessarily uniquely, 
         *  the name can basically serve as wildcard to select a group 
         *  of meshes with similar animation setup)*/ 
        C_STRUCT aiString mName; 
 
        /** Size of the #mKeys array. Must be 1, at least. */ 
        unsigned int mNumKeys; 
 
        /** Key frames of the animation. May not be NULL. */ 
        C_STRUCT aiMeshKey* mKeys; 
} 
What is actually being referenced? Is it a pointer to an array of the aiMeshAnim structures?

Possibly. But not necessarily. Pointers and arrays in C are kinda interchangeable. It's possible that it's pointing to an array of pointers, but I wouldn't assume that. A pointer to a pointer is just that.

Here's an example using euphoria code (portable, 4.1 style):

-- going to create an int** 
atom ptr_to_ptr, ptr 
 
ptr = allocate( 4 ) 
poke4( ptr, 12345 ) 
 
ptr_to_ptr = allocate( sizeof( C_POINTER ) ) 
poke_pointer( ptr_to_ptr, ptr ) 
 

Now, ptr_to_ptr is itself a pointer, which points to ptr, which points to an integer with the value of 12345.

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu