Size of a char - Answers 1 byte (8 bits)
Size of a short - Answers 2 bytes (16 bits)
size of an int - Answers 4 bytes (32 bits)
size of a long - Answers 8 bytes (64 bits)
size of a float - Answers 4 bytes (32 bits)
size of a double - Answers 8 bytes (64 bits)
size of a boolean - Answers 1 byte (4 bits)
How do you compile code in C? - Answers gcc -Wall [filename].c -g -o [filename].out
Ternary Operator - Answers condition ? result 1 : result 2
7 == 5 ? 4 : 3
(is 7 = 5?)
yes: output 4
no: output 3
Stack - Answers This is where information is saved each time a function is called such as local
(auto) variables in a method or function. The memory is then removed after the function is
executed.
Heap - Answers Where dynamic memory allocation takes place and is managed by malloc,
realloc, calloc, and free. Memory stored in the heap has to be free'd at the end of the program to
avoid memory leaks.
Two's Complement - Answers The algorithm to get the negative of an integer.
-x == ~x + 1
how is the end of a string represented in a character sequence - Answers the null character '\0'
How can you change a character sequence after it is initialized. - Answers You cannot assign
them directly (char myword[ ] = "Hello"; myword = "Bye;). You must reassign each element
individually.
myword[0] = 'B';myword[1] = 'y';myword[2] = 'e';myword[3] = '\0';
What do pointers do - Answers When a variable is declared, its value is assigned to a specific