
please wait
static_cast<int>(some_float)
will convert the float to an int, but yet it doesnt convert for example a string to an int or vice versa. metulburr@ubuntu:~$ sudo apt-cache search libboost [sudo] password for metulburr: libboost-dbg - Boost C++ Libraries with debug symbols libboost-dev - Boost C++ Libraries development files (default version) libboost-doc - Boost C++ Libraries documentation (default version) libboost-graph1.46-dev - generic graph components and algorithms in C++ libboost-graph1.46.1 - generic graph components and algorithms in C++ libboost-iostreams-dev - Boost.Iostreams Library development files (default version) libboost-iostreams1.46-dev - Boost.Iostreams Library development files libboost-iostreams1.46.1 - Boost.Iostreams Library libboost-program-options-dev - program options library for C++ (default version) libboost-program-options1.46-dev - program options library for C++ libboost-program-options1.46.1 - program options library for C++ libboost-python-dev - Boost.Python Library development files (default version) libboost-python1.46-dev - Boost.Python Library development files libboost-python1.46.1 - Boost.Python Library libboost-regex1.46-dev - regular expression library for C++ libboost-regex1.46.1 - regular expression library for C++ libboost-serialization-dev - serialization library for C++ (default version) libboost-serialization1.46-dev - serialization library for C++ libboost-serialization1.46.1 - serialization library for C++ libboost-test-dev - components for writing and executing test suites (default version) libboost-test1.46-dev - components for writing and executing test suites libboost-test1.46.1 - components for writing and executing test suites libboost1.46-dbg - Boost C++ Libraries with debug symbols libboost1.46-dev - Boost C++ Libraries development files libboost1.46-doc - Boost.org libraries documentation libboost-all-dev - Boost C++ Libraries development files (ALL, default version) libboost-chrono1.48-dev - C++ representation of time duration, time point, and clocks libboost-chrono1.48.0 - C++ representation of time duration, time point, and clocks libboost-date-time-dev - date-time libraries based on generic programming (default version) libboost-date-time1.46-dev - set of date-time libraries based on generic programming concepts libboost-date-time1.46.1 - set of date-time libraries based on generic programming concepts libboost-date-time1.48-dev - set of date-time libraries based on generic programming concepts libboost-date-time1.48.0 - set of date-time libraries based on generic programming concepts libboost-filesystem-dev - filesystem operations in C++ (default version) libboost-filesystem1.46-dev - filesystem operations (portable paths, iteration over directories, etc) in C++ libboost-filesystem1.46.1 - filesystem operations (portable paths, iteration over directories, etc) in C++ libboost-filesystem1.48-dev - filesystem operations (portable paths, iteration over directories, etc) in C++ libboost-filesystem1.48.0 - filesystem operations (portable paths, iteration over directories, etc) in C++ libboost-graph-dev - generic graph components and algorithms in C++ (default version) libboost-graph-parallel-dev - generic graph components and algorithms in C++ (default version) libboost-graph-parallel1.46-dev - generic graph components and algorithms in C++ libboost-graph-parallel1.46.1 - generic graph components and algorithms in C++ libboost-graph-parallel1.48-dev - generic graph components and algorithms in C++ libboost-graph-parallel1.48.0 - generic graph components and algorithms in C++ libboost-graph1.48-dev - generic graph components and algorithms in C++ libboost-graph1.48.0 - generic graph components and algorithms in C++ libboost-iostreams1.48-dev - Boost.Iostreams Library development files libboost-iostreams1.48.0 - Boost.Iostreams Library libboost-locale1.48-dev - C++ facilities for localization libboost-locale1.48.0 - C++ facilities for localization libboost-math-dev - Boost.Math Library development files (default version) libboost-math1.46-dev - Boost.Math Library development files libboost-math1.46.1 - Boost.Math Library libboost-math1.48-dev - Boost.Math Library development files libboost-math1.48.0 - Boost.Math Library libboost-mpi-dev - C++ interface to the Message Passing Interface (MPI) (default version) libboost-mpi-python-dev - Python interface to the Message Passing Interface (MPI) (default version) libboost-mpi-python1.46-dev - C++ interface to the Message Passing Interface (MPI), Python Bindings libboost-mpi-python1.46.1 - C++ interface to the Message Passing Interface (MPI), Python Bindings libboost-mpi-python1.48-dev - C++ interface to the Message Passing Interface (MPI), Python Bindings libboost-mpi-python1.48.0 - C++ interface to the Message Passing Interface (MPI), Python Bindings libboost-mpi1.46-dev - C++ interface to the Message Passing Interface (MPI) libboost-mpi1.46.1 - C++ interface to the Message Passing Interface (MPI) libboost-mpi1.48-dev - C++ interface to the Message Passing Interface (MPI) libboost-mpi1.48.0 - C++ interface to the Message Passing Interface (MPI) libboost-program-options1.48-dev - program options library for C++ libboost-program-options1.48.0 - program options library for C++ libboost-python1.48-dev - Boost.Python Library development files libboost-python1.48.0 - Boost.Python Library libboost-random-dev - Boost Random Number Library (default version) libboost-random1.46-dev - Boost Random Number Library libboost-random1.46.1 - Boost Random Number Library libboost-random1.48-dev - Boost Random Number Library libboost-random1.48.0 - Boost Random Number Library libboost-regex-dev - regular expression library for C++ (default version) libboost-regex1.48-dev - regular expression library for C++ libboost-regex1.48.0 - regular expression library for C++ libboost-serialization1.48-dev - serialization library for C++ libboost-serialization1.48.0 - serialization library for C++ libboost-signals-dev - managed signals and slots library for C++ (default version) libboost-signals1.46-dev - managed signals and slots library for C++ libboost-signals1.46.1 - managed signals and slots library for C++ libboost-signals1.48-dev - managed signals and slots library for C++ libboost-signals1.48.0 - managed signals and slots library for C++ libboost-system-dev - Operating system (e.g. diagnostics support) library (default version) libboost-system1.46-dev - Operating system (e.g. diagnostics support) library libboost-system1.46.1 - Operating system (e.g. diagnostics support) library libboost-system1.48-dev - Operating system (e.g. diagnostics support) library libboost-system1.48.0 - Operating system (e.g. diagnostics support) library libboost-test1.48-dev - components for writing and executing test suites libboost-test1.48.0 - components for writing and executing test suites libboost-thread-dev - portable C++ multi-threading (default version) libboost-thread1.46-dev - portable C++ multi-threading libboost-thread1.46.1 - portable C++ multi-threading libboost-thread1.48-dev - portable C++ multi-threading libboost-thread1.48.0 - portable C++ multi-threading libboost-timer1.48-dev - C++ wall clock and CPU process timers libboost-timer1.48.0 - C++ wall clock and CPU process timers libboost-wave-dev - C99/C++ preprocessor library (default version) libboost-wave1.46-dev - C99/C++ preprocessor library libboost-wave1.46.1 - C99/C++ preprocessor library libboost-wave1.48-dev - C99/C++ preprocessor library libboost-wave1.48.0 - C99/C++ preprocessor library libboost1.46-all-dev - Boost C++ Libraries development files (ALL) libboost1.48-all-dev - Boost C++ Libraries development files (ALL) libboost1.48-dbg - Boost C++ Libraries with debug symbols libboost1.48-dev - Boost C++ Libraries development files libboost1.48-doc - Boost.org libraries documentation metulburr@ubuntu:~$ |
|
|
return string(1, ch);
|
|
Note that your cha2str could be done simply as return string(1, ch); |
cout << (float)10/3;
for the float/int conversions