Ok, second try. I declared mwfact in main.c and as extern in dwm.h so that I can use it in tile.c and I used emallocz and initialized it in the initlayouts() function in screen.c which is called from the setup() function in main.c (seemed to be the most appropriate place).
Hope this is a better solution. I'm still learning. Thanks for your help, -Evan On 9/5/07, y i y u s <[EMAIL PROTECTED]> wrote: > > I wanted to use ntags to define the size of > > mwfact[], but can't due to compiler errors. ... > > You can't make double mwfact[ntags] because ntags is a variable, what > you can do is: > > double *mwfact; > mwfact = emalloc(ntags * sizeof(double)); > > emalloc is just a wrapper on the standard malloc to print an error > message and exit if something goes wrong. > And about initialization, why not doing it in the setup function in > main.c where everything is initialized? > I hope this tips were useful to you, regards, > > > -- > > > - yiyus || JGL . > >
dwm-4.4.1-mwfactpertag.diff
Description: Binary data
