C++ type conversion

Where can I find an overview of type conversion, e.g. string to integer, etc.?

Because of the comments so far, I'll clarify: I'm looking for a list /table that says: To convert a string to an int, use: ... And same for other data types (where possible): double to int, char to string, ...


If it's string to/from other types then stringstream or boost::lexical_cast.

For other types it will depend on the types, but maybe look up the standard cast templates? static_cast and dynamic_cast should do most things you need, or there is const_cast and reinterpret_cast which tend to only be useful for dealing with legacy systems.

Streams are essentially C++'s string conversion operators.

You also have available C's conversion method of sprintf, but that is massively error-prone and unsafe.

There are functions in the standard library to do string<->int conversions. You should grab any reference book on C++, or search Google.

I'm more familiar with C, but I believe the C++ functions are the same: atoi, strtoi, etc.

I would recommend to read the reference about the string class and then something about casting to different data types generally.

Need Your Help

python matrix linear differential equation

python math matrix linear-algebra

I have matrix differential equation diff(x) = A * x, x(0) = C, where:

password recovery for drupal

drupal passwords recovery

i forgot my drupal user id and password. Is there any way to recover it