It seems like the browser you are using has JavaScript disabled. As a result, the site will not function properly. We really want you to enable it so you may experience our site as we intended it. If you have no idea what we are talking about or if you need help, visit http://www.enable-javascript.com×
This website uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Find out more on our cookie page.×

Oops, it seems like you're using an old browser that we do not fully support. If you're able to, please upgrade your browser here.×
This website uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Find out more on our cookie page.×

You include the contents of a standard header by naming it in an
include directive,
as in:

#include <iostream> /* include I/O facilities */

You can include the standard headers in any order, a standard
header more than once, or two or more standard headers that define
the same macro or the same type.
Do not include a standard header within a declaration. Do not
define macros that have the same names as keywords before you include
a standard header.

A C++ library header includes any other C++ library headers
it needs to define needed types. (Always include explicitly any
C++ library headers needed in a translation unit, however, lest
you guess wrong about its actual dependencies.) A Standard C header
never includes another standard header. A standard header declares
or defines only the entities described for it in this document.

Every function in the library is declared in a standard header.
Unlike in Standard C, the standard header never provides a
masking macro,
with the same name as the function, that masks the function
declaration and achieves the same effect.

All names other than operator delete and
operator new in the C++ library headers are defined in the
std namespace,
or in a namespace nested within the std namespace.
You refer to the name
cin, for example,
as std::cin. Note, however, that macro names are not subject to
namespace qualification, so you always write
__STD_COMPLEX
without a namespace qualifier.

In some translation environments, including a C++ library header
may hoist external names declared in the std namespace
into the global namespace as well, with individual using
declarations for each of the names. Otherwise, the header does
not introduce any library names into the current namespace.

The C++ Standard requires that the
C Standard headers declare
all external names in namespace std, then hoist them into
the global namespace with individual using declarations
for each of the names.
But in some translation environments the C Standard headers
include no namespace declarations,
declaring all names directly in the global namespace.
Thus, the most portable way to deal with namespaces is to follow
two rules:

To assuredly declare in namespace std
an external name that is traditionally declared
in <stdlib.h>, for example,
include the header <cstdlib>. Know that
the name might also be declared in the global namespace.

To assuredly declare in the global namespace
an external name declared in <stdlib.h>,
include the header <stdlib.h> directly. Know that
the name might also be declared in namespace std.

Thus, if you want to call
std::abort()
to cause abnormal termination,
you should include <cstdlib>.
And if you want to call abort(),
you should include
<stdlib.h>.

Alternatively, you can write the declaration:

using namespace std;

which assuredly hoists all library names into the current namespace.
If you write this declaration immediately after all include
directives, you hoist the names into the global namespace.
You can subsequently ignore namespace
considerations in the remainder of the translation unit.
You also avoid most dialect differences across different
translation environments.

Unless specifically indicated otherwise, you may not define names in
the std namespace, or in a namespace nested within the
std namespace.

A member function name in a library class may have additional
function signatures over those listed in this document. You can
be sure that a function call described here behaves as expected,
but you cannot reliably take the address of a library member function.
(The type may not be what you expect.)

A library class may have undocumented (non-virtual) base classes.
A class documented as derived from another class may, in fact,
be derived from that class through other undocumented classes.

A type defined as a synonym for some integer type may be the
same as one of several different integer types.

A bitmask type can
be implemented as either an integer type or an enumeration.
In either case, you can perform bitwise operations (such as AND
and OR) on values of the same bitmask type. The elementsA and B of a bitmask type are nonzero
values such that A & B is zero.

A library function that has no exception specification can
throw an arbitrary exception, unless its definition clearly
restricts such a possibility.

On the other hand, there are some restrictions you can count on:

The Standard C library uses no
masking macros. Only specific function
signatures are reserved, not the names of the functions themselves.

A library function name outside a class will not have
additional, undocumented, function signatures. You can reliably
take its address.

Base classes and member functions described as virtual are
assuredly virtual, while those described as non-virtual are
assuredly non-virtual.

Two types defined by the C++ library
are always different unless this document explicitly suggests
otherwise.

Functions supplied by the library, including the default versions of
replaceable functions,
can throw at most those exceptions listed in any exception
specification.
No destructors supplied by the library throw exceptions.
Functions in the
Standard C library
may propagate an exception, as when
qsort calls a comparison
function that throws an exception, but they do not otherwise throw
exceptions.

The simplest use of iostreams requires only that you include
the header <iostream>. You can then extract values from
cin, to read the
standard input.
The rules for doing so are outlined in the description of the class
basic_istream.
You can also insert values to
cout, to write the
standard output.
The rules for doing so are outlined in the description of the class
basic_ostream.
Format control common to both extractors and insertors is managed
by the class basic_ios.
Manipulating this format information in the guise of extracting and
inserting objects is the province of several
manipulators.

You can perform the same iostreams operations on files that you
open by name, using the classes declared in
<fstream>.
To convert between iostreams and objects of class
basic_string,
use the classes declared in <sstream>.
And to do the same with C strings,
use the classes declared in <strstream>.

The remaining headers provide support services, typically of direct
interest to only the most advanced users of the iostreams classes.

Before the target environment calls the function
main, and after it stores
any constant initial values you specify in all objects that have
static duration, the program executes any remaining constructors
for such static objects. The order of execution is not specified
between translation units, but you can nevertheless assume that some
iostreams objects are properly initialized
for use by these static constructors. These control
text streams:

In this implementation,
exception handling can be either enabled or disabled.
This document describes all behavior as if exception handling is enabled.
If exception handling is disabled, however:

Throw specifications in library function declarations
are not actually present.

Catch clauses in library function definitions likewise are not
actually present. It is not possible for the program to catch an
exception, except in the limited sense outlined below. Hence, the
library has no occasion to rethrow an exception.

Rather than throw an exception, as in throw ex, the library
actually calls ex._Raise().

Here, void _Raise()
is a member function of class exception,
the base class for all exceptions thrown by the library. It performs the following
operations, in order:

If a raise handler
has been registered by an earlier call to the static member function
exception::
_Set_raise_handler(void
(*)(const exception&), then _Raise calls the
raise handler.

_Raise then calls the protected virtual member function
void _Doraise(), which typically calls
_Throw(*this) in any class derived
from exception. (This ensures that the most derived version
of the virtual public member function what gets called
by _Throw, as outlined below.)

_Raise then calls _Throw(*this).

The replaceable global function
void _Throw(const exception& ex)
never returns to its caller.
If the pointer returned by ex.what() is not a null pointer,
the function writes to the
standard error output stream
a diagnostic message that includes the
null-terminated string
designated by the pointer. In any event, the function then calls
abort.

The net effect of all this machinery is to supply several levels of control,
in lieu of the normal exception-handling machinery:

You can dynamically specify a raise handler that is called whenever the
library would normally throw any exception
derived from class exception.

You can override _Doraise, in a class you derive
from exception, to get control whenever an object of that
class would normally be thrown by the library (assuming that any raise handler
you register returns to its caller).

You can define your own version of _Throw, to statically handle
termination on all thrown exceptions as you see fit.

1. Download the tools

Before you start developing, you'll need to visit the Downloads tab. Here you'll find downloads for the BlackBerry 10 Native SDK, BlackBerry 10 Device Simulator, and some other useful tools.

2. Try the sample apps

Now featuring a filter control, the Sample apps tab allows you to search for samples by name or by feature.

Select either the Core or Cascades radio buttons to display the samples relevant to you.

3. Educate yourself

The Documentation tab contains tons of examples, tutorials, and best practices to guide you along the path towards building an awesome app.

You can access all the documentation that you need in the left-hand navigation.

4. Start developing

The Reference tab is where you'll find essential details about how to use our APIs.

You can use the left-hand navigation to choose how you would like to browse the reference: by module, by topic, or alphabetically. If you have an idea of what you are looking for, start typing it in the Filter box.