Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How do I convert a number into string with C++?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Icos
Grandmaster Cheater
Reputation: 0

Joined: 12 May 2007
Posts: 524

PostPosted: Mon Jun 18, 2007 7:09 pm    Post subject: How do I convert a number into string with C++? Reply with quote

As title. I know that I can use the old C functions itoa() or sprintf() to accomplish that, but are there any other built-in functions in C++ that can perform the same job?
Thanks in advance.
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Mon Jun 18, 2007 7:10 pm    Post subject: Reply with quote

nope
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Mon Jun 18, 2007 7:11 pm    Post subject: Reply with quote

What exactly do you mean by making a number into a string? You mean get its ascii character? That would be typecasting and you would do this.

Code:

#include <iostream>

using namespace std;

int main()

{
    for (int x = 0; x < 256; x++) {
        cout<< x<<". "<< (char)x <<" ";
    }   
    cin.get();
}



Otherwise I don't exactly get what your saying. If you could give me and example it would be nice.

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Icos
Grandmaster Cheater
Reputation: 0

Joined: 12 May 2007
Posts: 524

PostPosted: Mon Jun 18, 2007 7:12 pm    Post subject: Reply with quote

appalsap wrote:
nope

So I must stick to the old C functions to perform that?
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Mon Jun 18, 2007 7:13 pm    Post subject: Reply with quote

I don't even understand you unless you mean typecasting.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Mon Jun 18, 2007 7:14 pm    Post subject: Reply with quote

oib111 wrote:
What exactly do you mean by making a number into a string? You mean get its ascii character? That would be typecasting and you would do this.


he means turning 12345 into "12345"- the only way to do that is with a big table with the digits and their ascii representations, and loop through every character in the string you want to fill, filling it up. that is itoa.
Back to top
View user's profile Send private message
Icos
Grandmaster Cheater
Reputation: 0

Joined: 12 May 2007
Posts: 524

PostPosted: Mon Jun 18, 2007 7:18 pm    Post subject: Reply with quote

Thanks appal. It has cleared things up much better.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites