Variables & Arrays - Gokborg/MCava GitHub Wiki

Creating a Variable

Variables are stored in memory locations by default.

//Creating an integer variable
int a = 3;

//Creating a character variable
char b = '3';

However, you can also use the keyword fast to try to store them in registers.

//Creating a fast integer variable
fast int a = 3;

//Creating a fast character variable
fast char b = '3';

Creating an Array

Arrays can be created in multiple ways.

//Size is implied
int[] myArray = {1,2,3};

//Size is specified
int[3] myArray = {1,2,3};

//Allocates space with no initial values
int[3] myArray;

//Similarly with char arrays
char[] myArray = {'a', 'b', 'c'};
char[3] myArray = {'a', 'b', 'c'};
char[3] myArray;