🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

A little off the point but...

Started by
0 comments, last by Ozz 24 years, 1 month 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.
Advertisement
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