Difference between revisions of "C Specifics"
esse quam videri
(→Assignment) |
|||
Line 7: | Line 7: | ||
<div style="border:1px dashed black"> | <div style="border:1px dashed black"> | ||
: | : | ||
− | :char | + | :char VariableName; |
: | : | ||
: | : | ||
</div> | </div> | ||
− | + | ===Scope=== | |
===Initialization=== | ===Initialization=== | ||
Variable initialization may only occur once you have declared a variable. | Variable initialization may only occur once you have declared a variable. | ||
Line 35: | Line 35: | ||
===Reallocation=== | ===Reallocation=== | ||
===Deallocation=== | ===Deallocation=== | ||
+ | ==Functions== | ||
+ | ===Declaration=== | ||
+ | ===Scope=== | ||
+ | ===Initialiation=== | ||
+ | ==Include Files== | ||
+ | ==Header Files== |
Revision as of 08:35, 21 August 2009
Contents
Variables
Declaration
Variable declaration in standard C requires 3 simple commands.
- First, tell the computer what type of variable you would like to store.
- Next, give the variable a unique name.
- Finally, end your declaration.
- char VariableName;
Scope
Initialization
Variable initialization may only occur once you have declared a variable. To initialize a variable in standard C, simply use the assignment operator (=) immediately after the variable declaration, preceding the semi-colon.
- int VariableName = 5;
Assignment
Assigning a variable a value in standard C, is as simple as placing the assignment operator in-between the object name and value.
- int MyInt;
- MyInt = 0;