A little off the point but...
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.
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:
src2.cpp:
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
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
Popular Topics
Advertisement
Recommended Tutorials
Advertisement