• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/17

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

17 Cards in this Set

  • Front
  • Back
What are the basic data types provided by objective C?
int
float
double(about twice the accuracy as float)
char
Integers can be represented as base base 8 and base 16, how can this be done?
base 8 - start the number with 0.
050. represents 40 in decimal.

Base 16 - start the number with 0x or 0X.
0xFFEEDD
what does the following formats do?

%o
%i
%#0
%x
%#x, %#X
%f
%e
%g
%c
%li
%lli
%o - display as an octal
%i - display as an integer
%#o - display as octal with leading 0
%x - display as hexidecimal
%#x, %#X - display as hexadecimal with leading 0x or 0X
%f - display floating point number
%e - display exponential number
%g - When the exponent is less than -4 or greater than 5 display exponential otherwise float
%c - display the value of a character
%li - display the value of a long int(l can be used as the modifier for ""%i , %o , %x"
%lli - display as long long int
What is the datatype size(bits) dependent on?
It's machine dependent. An integer is usually guaranteed to be at least 32bits however it can be more.
A hexadecimal floating constant consists
a leading 0x or 0X, followed by one or more decimal or hexadecimal digits, followed by a p or P, followed by an optionally signed binary exponent. For example, 0x0.3p10 represents the value 3/16 × 210 = 0.5.
what data type does the objective-c compiler consider floating point numbers?
the Objective-C compiler considers all floating-point constants to be double values.To explicitly express a float constant, append either f or F to the end of the number, like so:
12.5f
How is a character represented?
By a single quote. ex. 'a'.
The character constant ’\n’, the newline character, is a valid character constant even though it seems to contradict the rule cited previously.
What qualifiers can be used infront of 'int'?
long
long long
short
unsigned
signed
FACTS:
As with floats and doubles, the particular accuracy of a long variable depends on your particular computer system. On many systems, an int and a long int both have the same range and can be used to store integer values up to 32 bits wide (231 – 1, or 2,147,483,647).

A constant value of type long int is formed by optionally appending the letter L (in upper or lower case)
No spaces are permitted be- tween the number and the L.
..
How long is long long guaranteed to be?
long long is guaranteed to be at least 64 bits wide.
FACT:
The long qualifier is also allowed in front of a double
long double US_deficit_2004;
..
A long double constant is written as a floating constant with an l or L immediately following, like so:
1.234e+7L
..
To display a long double, you use the L modifier. So %Lf would display a long dou- ble value in floating-point notation, %Le would display the same value in scientific nota- tion, and %Lg would tell NSLog to choose between %Lf and %Le.
..
How many bits are you guaranteed for a short int?
You are guaranteed that the amount of space allocated for a short int will not be less than 16 bits.
Facts:
No way exists to explicitly write a constant of type short int in Objective-C.To dis- play a short int variable, place the letter h in front of any of the normal integer-conver- sion characters: %hi, %ho, or %hx.
..
Facts:
The unsigned qualifier can be placed infront of an int.
An unsigned int constant is formed by placing a 'u' or 'U' after the constant, like so: 0x00ffU

You can combine the u (or U) and l (or L) when writing an integer constant, so this tells the compiler to treat the constant 20000 as unsigned long:
20000UL
..
Facts: When declaring variables to be of type long int, short int, or unsigned int, you can omit the keyword int.Therefore, the unsigned variable counter could have been equivalently declared as follows:
unsigned counter;

You can also declare char variables to be signed/unsigned.
..