1.1 Declarations
Computers must store data in memory. You access the memory by assigning it a name as a variable, for example:
int x;
This allocates memory for an integer variable called x. You can write to the memory by assigning a value to x:
x = 6;
All variables must be declared before they are used. This means telling the compiler what type of data a variable represents. The syntax of a declaration is:
No comments:
Post a Comment