View Single Post
Old 26 September 2017, 02:07   #12
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by milikabdp View Post
Same error... tricky isnt it cant write to it, cant read from it.
oh, I removed that example, but u were faster

#1) another one from my lightwave plugin stuff.
they do initialze the member before they do the struct, in this case typedef struct:
Code:
int spln,dirn,thickness;
double darken,brighten;

typedef struct VIDIMAGE_TAG{
    int spln;
    int dirn;
    int thickness;
    double darken;
    double brighten;
} VIDIMAGE;
....
// this is a function, LWInstance / LWError are known types
LWInstance create(LWError *error)
{
                VIDIMAGE *lwinst;

        lwinst = malloc(sizeof(struct VIDIMAGE_TAG));
        if (!lwinst)
        {
                *error = "Error allocating memory!";
                return NULL;
        }

                lwinst->thickness = 1;
                lwinst->spln = 4;
                lwinst->darken = 0.75;
                lwinst->brighten = 0.0;
...
};
this does build with sasc and gcc crosscompilers, like the one used with AmiDevCpp
emufan is offline  
 
Page generated in 0.04695 seconds with 11 queries