Advertisement

A little off the point but...

Started by May 15, 2000 08:08 AM
0 comments, last by Ozz 24 years, 9 months ago
I`m stuck, has anyone seen a program to texture 3ds models independant of any other programs, i.e to a Max/Photoshop Plugin. Also could someone explain the use of ''static'' and ''extern''? Thanks.
I can explain you these keywords:
e.g.

void myfunc()
{
static int x=0;
......
}

Use static if a variable should only be visible inside a function but also should be "global", I mean it should keep the value when the function returns until it''s called the next time - if a local variable isn''t static, it''s created new every time the function is called. The initialization of a static variable is done only the first time the function is called.

src1.cpp:

#include "src1.h"
int xx;
...

src2.cpp:

....
void func1()
{
extern int xx;
....
}


Use extern if there''s a global variable which you want to use in your function but which is in another source file.

You can also declare a global variable as static. If you do so, this global variable can''t be used in other source files by using extern.

Visit our homepage: www.rarebyte.de.st

GA
Visit our homepage: www.rarebyte.de.stGA

This topic is closed to new replies.

Advertisement