202 Flashcards
What is the main function?
This is where the program begins execution
How can you comment a C file?
// TEXT or /* TEXT */
What is a short?
A type of integer
Shorter than a normal integer
16 bits
Can be signed and unsigned
What is an int?
A normal integer
32 bits
Can be signed and unsigned
What is a long?
A type of integer.
Longer than a normal integer
64 bits
Can be signed or unsigned
What is a char?
A character variable
8 bits
Can be signed or unsigned
What is a string?
Multiple characters one after the other.
What is a float?
A floating point variable. A number with decimal places.
Single precision
32 bits
7 decimal places
What is a double?
A floating point variable. A number with decimal places.
double precision
64 bits
16 decimal places
What is a global variable?
Can be accessed by all parts of code.
What is a local variable?
Can be accessed by only certain sections of code
What is a literal?
This is when there is a number in the code that is not stored in a variable.
Specified in: Decimal, binary, hexadecimal and scientific notion
What the arithmetic operators? What do they do?
Mathematical operations on binary \+ Addition - Subtraction * Multiplication / Division % Modulo (Finds the remainder) \++ Increments the variable by 1 -- Decrements the variable by 1
What is the notation for ++ and –?
b = 5;
b++;
b–;
IT IS NOT:
c = b++;
What is a relational operator? What are they?
Compares two variables and outputs a boolean: > Greater than < Less than == Equivalent != Not equivalent >= Greater than or equal to <= Less than or equal to
What are some logical operators and their functions?
Does a logical operation on the overall number. A 0 is a binary 0. Any number that is not 0 is a 1.
&& AND
|| OR
! NOT
What is a bitwise operation?
Does logical operations on the binary number of the number specified.
What are some bitwise operations and their functions?
& AND | OR ^ XOR ~ NOT << Shift left >> Shift right
What is an assignment operator?
=
This equates the variable on the left to the variables and operations on the right
What is precedence?
This is the order in which operations are done: Most important ( ) brackets ! or ~ [Read from right to left] * or / or % \+ or - Least important
What is the specifier for a signed integer?
d or i
What is the specifier for an unsigned integer?
u
What is the specifier for a character integer?
c
What is the specifier for a string?
s
What is the specifier for a floating point?
F or f
What is the specifier for a double in standard form?
e or E
What is the specifier for a double in normal or exponential form?
g or G
The microcontroller decides to put it in either exponential or normal form
What is the specifier for an unsigned integer in hexadecimal?
x or X
What is the specifier for an unsigned integer in octadecimal?
o
What does .4f mean?
It means a floating point with 4 decimal places