static & extern function ???

hy, thanks for reading...

i'm learnig C++ 2 weaks so far and wanna ask if:
does enything like this exist?

for example:
static short SomeFunc (short x, short y);

OR

extern int SomeFunc (int x, int y);

OR

int SomeFunc (static int x, extern int y);

I've heard that's posible in templates but it look's nonstandar to me.
any help with this noobish question :)

btw. I know what static and extern keyword means and how to use those keywords but this examples zzzz...
Last edited on
static short SomeFunc (short x, short y); means this function is restricted to file scope.

extern int SomeFunc (int x, int y);
The extern keyword is redundant (but not illegal) as functions are extern by default.

int SomeFunc (static int x, extern int y); the static and extern keywords here are illegal.



Last edited on
thanx guestgulkan, I get it now :)

however i'm confused with static qualifer now :(

Q:
let's say :
static int SomeVar
this means SomeVar is restricted to the current scope (inside {} or to file scope if global declared) wright?
but, will SomeVar be static like static members in classes (wich are counters of objects for example) OR like static variables inside functions which are remembered until program exit's

what's diference?
--> static means: restricted to scope AND doesnt get out of scope until program ends--> where ever used in function or global to file or inside class or inside header zzzzzz confused help :)
Topic archived. No new replies allowed.