Save
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

C++ Common Types

The most important types are int, char, bool, and double; also classes. "Quiz 1"

QuestionAnswer
int x; Fastest integer type (16-32 bits), also short, long, and unsigned
char x; 8-bit character, '\0' to '\xFF' or -128 to 127
double x; 64 bit real + or - 1.8e308, 14 significant digits, also float
bool x; true or false
const T x; Non-modifiable object
T f(...) {...} Defines f as a function returning T
T* p; Pointer to T (*p is a T object)
T a[N]; Array of N elements of T, a[0] to a[N-1]
static T x; Place x in data segment
register T x; (rare) Hint to optimize for speed
volatile T x; (rare) x may be modified externally
t& y=x; Reference, y is an alias for x, which both have type T
How do you include a standard library type and the beginning of the program? #include <header>
What standard type must be included at the beginning of the program? using namespace std;
istream / iostream Standard input (cin)
ostream / iostream Output (cout, cerr, clog)
ifstream / fstream Input file
ofstream / fstream Output file
string / string Sequence of char
vector<T> / vector Expandable array/stack of T
deque<T> / deque Array/double ended queue
list<T> / list List/stack/queue of T
map<T1,T2> / map Associative mapping of T1 to T2
set<T1> / set A map with keys only
pair<T1,T2> / map or utility Two objects of type T1 and T2
priority_queue<T> / queue Sorted queue
stack<T> / stack Stack
bitset<N> / bitset Array of N bool with logical operations
valarray<T> / valarray Array with arithmetic operations
complex<T> / complex Complex number
iterator / (Included with container) Pointer into a container
const_iterator / (Included with container) Pointer not allowing element assignment
exception / stdexcept, exception Hierarchy of exception types
algorithm min(), max(), swap(), sort(), copy(), equal()
numeric accumulate(), inner_product()
iterator back_inserter()
functional equal_to(), less(), bind2nd()
new set_new_handler()
cstdlib atoi(), atof(), abs(), rand(), system(), exit()
cctype isalpha(), isgigit(), tolower(), toupper()
cmath sqrt(), log(), exp(), pow(), sin(), cos(), atan()
ctime clock(), time()
cstring strleng(), memset(), memmove(), memcmp()
cstdio printf(), fopen(), getc(), perrer()
cassert (debugging) assert()
What most important type does C++ allow you to create on your own? Define it. A class is a abstract data structure and an associated set of member functions (methods) and related type declarations which can be associated with the class or instances (objects) of the class. A class is divided into public and private implementations.
Define inheritance in one sentence: Inheritance is a hierarchy of classes, and it is used to write a specialized or enhanced version of another class; For example, an ofstream is a type of ostream.
Define polymorphism in one sentence: Polymorphism is the technique of coding a common interface for a hierarchy of classes; For example, A child object is allowed wherever a parent object is expected.
class T {...}; Defines T as a collection of types, objects, and member functions
template <class T> ... Defines a set of functions or classes over all T
typedf T U; Defines type U is a synonym for T
enum T {...}; Defines T as an int, and set of int constants
struct T {...}; Like a class, except default scope of members is public
union T {...}; A struct with object members overlapping in memory
namespace N {...}; Defines a scope for a collection of types, objects, and functions
Created by: themagicdwarf
Popular Computers sets

 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards