202 Flashcards

1
Q

What is the main function?

A

This is where the program begins execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can you comment a C file?

A
// TEXT
or 
/*
TEXT
*/
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a short?

A

A type of integer
Shorter than a normal integer
16 bits
Can be signed and unsigned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is an int?

A

A normal integer
32 bits
Can be signed and unsigned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a long?

A

A type of integer.
Longer than a normal integer
64 bits
Can be signed or unsigned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a char?

A

A character variable
8 bits
Can be signed or unsigned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a string?

A

Multiple characters one after the other.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a float?

A

A floating point variable. A number with decimal places.
Single precision
32 bits
7 decimal places

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a double?

A

A floating point variable. A number with decimal places.
double precision
64 bits
16 decimal places

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a global variable?

A

Can be accessed by all parts of code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a local variable?

A

Can be accessed by only certain sections of code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a literal?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What the arithmetic operators? What do they do?

A
Mathematical operations on binary
\+ Addition
- Subtraction
* Multiplication
/ Division
% Modulo (Finds the remainder)
\++ Increments the variable by 1
-- Decrements the variable by 1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the notation for ++ and –?

A

b = 5;
b++;
b–;

IT IS NOT:
c = b++;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a relational operator? What are they?

A
Compares two variables and outputs a boolean:
> Greater than
< Less than
== Equivalent
!= Not equivalent
>= Greater than or equal to
<= Less than or equal to
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are some logical operators and their functions?

A

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

17
Q

What is a bitwise operation?

A

Does logical operations on the binary number of the number specified.

18
Q

What are some bitwise operations and their functions?

A
&amp; AND
| OR
^ XOR
~ NOT
<< Shift left
>> Shift right
19
Q

What is an assignment operator?

A

=

This equates the variable on the left to the variables and operations on the right

20
Q

What is precedence?

A
This is the order in which operations are done:
Most important
( ) brackets
! or ~ [Read from right to left]
* or / or %
\+ or - 
Least important
21
Q

What is the specifier for a signed integer?

A

d or i

22
Q

What is the specifier for an unsigned integer?

A

u

23
Q

What is the specifier for a character integer?

A

c

24
Q

What is the specifier for a string?

A

s

25
Q

What is the specifier for a floating point?

A

F or f

26
Q

What is the specifier for a double in standard form?

A

e or E

27
Q

What is the specifier for a double in normal or exponential form?

A

g or G

The microcontroller decides to put it in either exponential or normal form

28
Q

What is the specifier for an unsigned integer in hexadecimal?

A

x or X

29
Q

What is the specifier for an unsigned integer in octadecimal?

A

o

30
Q

What does .4f mean?

A

It means a floating point with 4 decimal places