On Tue, 2008-01-15 at 11:15 -0800,
rob.ahlberg@gmail.com wrote:
> I got an integer what I trying to use with allegro function
> textout_ex() but it wants an char[]/char* as arg... And I really don't
> know how to cast it to one...
You don't cast your int, you convert it.
#include <sstream>
#include <ostream>
....
std:

stringstream s;
s << my_int;
textout_ex(..., s.str().c_str(), ...);
or, if the allegro textout_ex function barfs due to something about
"const", try:
#include <vector>
#include <sstream>
#include <ostream>
....
std:

stringstream s;
s << my_int;
std::vector<char> v(s.str().begin(), s.str().end());
v.push_back('\0');
textout_ex(..., &v[0], ...); // &v[0] is okay because v.size() >= 1
--
Tristan Wibberley
Any opinion expressed is mine (or else I'm playing devils advocate for
the sake of a good argument). My employer had nothing to do with this
communication.