Level 21 Level 23
Level 22

[Quiz] Data Types & Flow Control


105 words 0 ignored

Ready to learn       Ready to review

Ignore words

Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.

All None

Ignore?
int
define integer
Double
Tipo reales de doble precisi¾n
float
support fractional values and has a sign bit for positive and negative numbers.
char
a character
Void
Funci¾n con resultado vacio
enum
Enumerated types, work as integers, convert t to integers, but give you symbolic names for sets. Some compilers warn you when you don't cover all elements on an enum in (switch-statements)
unsigned
Changes the type so that it does not have negative numbers, giving you a larger upper bound but nothing lower than 0.
signed
Gives you negative and positive numbers, but halves your upper bound in exchange for the same lower bound negative.
Long
Tipo enteros de largo alcance
Short
N·meros tipo enteros de poca precisi¾n
const
Indicates the variable won't change after being initialized.
volatile
Indicates that all bets are off, and the compiler should leave this alone and try not to do any fancy optimizations to it. You usually only need this if you're doing really weird stuff to your variables.
register
high-speed memory located inside the CPU
== Type Conversion ==
C uses a sort of "stepped type promotion" mechanism, where it looks at two operands on either side of an expression, and promotes the smaller side to match the larger side before doing the operat…
long double
10 degrees of minimum precision
Type Sizes
The stdint.h defines both a set of typdefs for exact sized integer types, as well as a set of macros for the sizes of all the types. This is easier to work with than…
int8_t
8 bit signed integer.
uint8_t
8 bit unsigned integer.
int16_t
16 bit signed integer.
uint16_t
16 bit unsigned integer.
int32_t
32 bit signed integer.
uint32_t
32 bit unsigned integer.
int64_t
64 bit signed integer.
uint64_t
64 bit unsigned integer.
INT(N)_MAX
Maximum positive number of the signed integer of bits (N), such as INT16_MAX.
INT(N)_MIN
Minimum negative number of signed integer of bits (N).
UINT(N)_MAX
Maximum positive number of unsigned integer of bits (N). Since it's unsigned the minimum is 0 and can't have a negative value.
| WARNING |
Pay attention! Do not go looking for a literal INT(N)_MAX definition in any header file. I'm using the (N) as a placeholder for any number of bits your platform currently supports. This (N) coul…
int_least(N)_t
holds at least (N) bits.
uint_least(N)_t
holds at least (N) bits unsigned.
INT_LEAST(N)_MAX
max value of the matching least (N) type.
INT_LEAST(N)_MIN
min value of the matching least (N) type.
UINT_LEAST(N)_MAX
unsigned maximum of the matching (N) type.
int_fast(N)_t
similar to int_least*N*_t but asking for the "fastest" with at least that precision.
uint_fast(N)_t
unsigned fastest least integer.
INT_FAST(N)_MAX
max value of the matching fastest (N) type.
INT_FAST(N)_MIN
min value of the matching fastest (N) type.
UINT_FAST(N)_MAX
unsigned max value of the matching fastest (N) type.
intptr_t
a signed integer large enough to hold a pointer.
uintptr_t
an unsigned integer large enough to hold a pointer.
INTPTR_MAX
max value of a intptr_t.
INTPTR_MIN
min value of a intptr_t.
UINTPTR_MAX
unsigned max value of a uintptr_t.
intmax_t
biggest number possible on that system.
uintmax_t
biggest unsigned number possible.
INTMAX_MAX
largest value for the biggest signed number.
INTMAX_MIN
smallest value for the biggest signed number.
UINTMAX_MAX
largest value for the biggest unsigned number.
PTRDIFF_MIN
minimum value of ptrdiff_t.
PTRDIFF_MAX
maximum value of ptrdiff_t.
SIZE_MAX
maximum of a size_t.
== Available Operators ==
This is a comprehensive list of all the operators you have in the C language. In this list, I'm indicating the following:
(binary)
The operator has a left and right: X + Y.
(unary)
The operator is on its own: -X.
(prefix)
The operator comes before the variable: ++X.
(postfix)
Usually the same as the (prefix) version, but placing it after gives it a different meaning: X++.
(ternary)
There's only one of these, so it's actually called the ternary but it means "three operands": X ? Y : Z.
== Math Operators ==
These are your basic math operations, plus I put () in with these since it calls a function and is close to a "math" operation.
()
Function call
multiply
* (binary)
/
Operador aritmÚtico division
== Data Operators ==
These are used to access data in different ways and forms.
->
struct pointer access
.
struct value access
[]
Array inde
sizeofsize of a typ
size of a type or variable.
& (unary)
Address of
* (unary)
Value of
Logic Operators
These handle testing equality and inequality of variables.
!=
not equal
<=
less than or equal
==
equal (not assignment)
>=
greater than or equal
Bit Operators
These are more advanced and for shifting and modifying the raw bits in integers.
& (binary)
Bitwise and.
<<
Shift left.
>>
Shift right.
^
bitwise xor (exclusive or).
|
bitwise or.
~
compliment (flips all the bits).
Boolean Operators
Used in truth testing. Study the ternary operator carefully, it is very handy.
!
not
&&
Checks if both statements are true
||
Checks if either of two statements are true
? :
Ternary truth test, read X ? Y : Z as "if X then Y else Z".
Assignment Operators
Compound assignment operators that assign a value, and/or perform an operation at the same time. Most of the above operations can also be combined into a compound assignment operator.
=
Assignment symbol
%=
modulus assing
&=
bitwise and assing
*=
multiply assign
+=
plus assign
-=
minus assign
/=
divide assign
<<=
shift left, assign
>>=
shift right, assign
^=
bitwise xor, assign
|=
bitwise or, assign
Available Control Structures
There's a few control structures you haven't encountered yet:
do-while
do { ... } while(X); First does the code in the block, then tests the X expression before exiting.
break
What is the command to exit from a loop?
continue
What is the command to skip over a loop?
goto
Jumps to a spot in the code where you've placed a label:, and you've been using this in the dbg.h macros to go to the error: label.
short
Type modifier (sh...
long
Type modifier
register
… you actually can measure it improving the speed.