1/7
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Basic Types
integer/rational
range of values
signed/unsigned
precision
Literals
often need âtype conversionâ
Converting Floating Point to Integer
truncate the decimal point DONâT ROUND
Scopes
variables need to be in the right scope to be visible where they are needed
Local Scope
created when itâs declared and automatically destroyed when the function containing it ends
Global Scope
visible to the whole file
try not to use ad they take up too much memory
Variable Rules
must be declared before use
generally declared âcloseâ to where you need to use them
should be initialised with some value before use
if you donât you will be given a random number, different every time the program is run
Accessing Data at other Scopes
donât use global variables
pass data using using parameters to functions
return results using âreturnâ so functions evaluate to something
often assign the result of a function call into a variable to use later