Changes between Version 29 and Version 30 of ResumedC


Ignore:
Timestamp:
Jun 16, 2009, 6:06:17 PM (15 years ago)
Author:
Thanatermesis
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ResumedC

    v29 v30  
    4545
    4646==== Extern ====
    47 You should '''ignore''' it since its the default when there's no anything set. It means that you can use and/or re-declare a function on other ''files'' of the code
     47Since it is the default value out of any function (global mode), you should ignore it. You can use it too for say that a variable is declared from a different (outside) file
    4848
    4949==== Static ====
    5050You can use ''static'' inside a function or outside it, it has two different meanings:
    51      * Inside a function: You can ''pre'' set a value to a variable ''(static int foo = 5)'', then the first time you enter on the function it will be set to 5, but the next times it not set again, it just remember the last value used
    52      * Outside a function (global mode): You will use it only in the actual file (compilation unit), good for optimization but you can't use it on other files
     51 * Inside a function: You can ''pre'' set a value to a variable ''(static int foo = 5)'', then the first time you enter on the function it will be set to 5, but the next times it not set again, it just remember the last value used
     52 * Outside a function (global mode): You will use it only in the actual file (compilation unit), good for optimization but you can't use it on other files
     53
     54Also, you can use the static variable (out of any function) in order to avoid a double-declaration of the same variable, when you use static (globally) it is limited to the file so, in another file is a different variable without any relation.
     55
    5356
    5457