C variable definition

extern – Variables described by extern statements will not have any space allocated for them, as they should be properly defined elsewhere.

static – The static data type modifier is used to create permanent storage for variables. Static variables keep their value between function calls. When used in a class, all instantiations of that class share one copy of the variable.

const – The const keyword can be used to tell the compiler that a certain variable should not be modified once it has been initialized.

More C definition here

Advertisements

Published by

paragasu

Different. In a good way

One thought on “C variable definition”

  1. The term “static” is overloaded and can mean two things depending on the context. Global variablea already have “static storage”. At global scope the keyword “static” makes a variable or function invisible to other translation objects (their symbols are not exported). This helps reducing name collisions and also makes dynamic linking faster.

    – P

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s