2

Possible Duplicate:
Easiest way to convert int to string in C++

Does anyone know how to do that conversion?

I need to concatenate a intptr_t type to a string, and therefore need to convert it.

It's not an int, as It's a 64 bit OS.

Correct me if I'm wrong Thanks

1
  • It's the same as an int64_t then, most likely. Look it up on the header files to see what it's typedef'd as. Commented Nov 1, 2012 at 23:36

3 Answers 3

2

intptr_t is just a number. Therefore:

Sign up to request clarification or add additional context in comments.

Comments

2

Simple:

std::to_string(ip);

Well, simple if you have C++11.

Comments

1
std::stringstream ss;
ss << ip;
ss.str();

(or if you prefer:

ss << std::hex << ip;

)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.