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 


[VC++] Int to String for Textbox
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
blackmorpheus
Expert Cheater
Reputation: 0

Joined: 05 Apr 2008
Posts: 159

PostPosted: Wed Nov 26, 2008 3:38 pm    Post subject: Reply with quote

int value = 8;
char buffer[1000];
sprintf(buffer, "%i", value);

string will be stored in buffer.
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Wed Nov 26, 2008 8:43 pm    Post subject: Reply with quote

itoa
Back to top
View user's profile Send private message
Zand
Master Cheater
Reputation: 0

Joined: 21 Jul 2006
Posts: 424

PostPosted: Wed Nov 26, 2008 8:51 pm    Post subject: Reply with quote

Zerith wrote:
tombana wrote:
Zerith wrote:
Bizarro wrote:
sprintf(message,"%d",value);

converts int value to string message


First, using "%d" will convert it into a value not a string.

Second, it would only use the int as an ascii of the char.

You're wrong. Bizarro is right, that code will convert the value of 'value' to a string and put that string into 'message'.



Definition of "%d" by MSDN:

MSDN wrote:

d Signed decimal integer.


I suppose MSDN is wrong then?


MSDN is right; you're wrong.
Back to top
View user's profile Send private message
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Thu Nov 27, 2008 5:50 am    Post subject: Reply with quote

Zand wrote:
Zerith wrote:
tombana wrote:
Zerith wrote:
Bizarro wrote:
sprintf(message,"%d",value);

converts int value to string message


First, using "%d" will convert it into a value not a string.

Second, it would only use the int as an ascii of the char.

You're wrong. Bizarro is right, that code will convert the value of 'value' to a string and put that string into 'message'.



Definition of "%d" by MSDN:

MSDN wrote:

d Signed decimal integer.


I suppose MSDN is wrong then?


MSDN is right; you're wrong.


Eh..sorry, i wasn't thinking straight when i wrote the post.
Back to top
View user's profile Send private message MSN Messenger
ssaccount
Master Cheater
Reputation: 0

Joined: 29 Aug 2007
Posts: 391
Location: Finland

PostPosted: Thu Nov 27, 2008 7:41 am    Post subject: Reply with quote

Chaosis13 wrote:
Code:
int int1 = 20;
char char1[100];
_itoa (int1, char1, 10);
this->textBox1->Text = Convert::ToString(char1);


That works... And so does this....

Code:
int int1 = 20;
this->textBox1->Text = Convert::ToString(int1);


Ty. And screw C#, that will never be as good as C++.



Managed C++ sucks. Use normal if you want to use C++ and if you want to do .NET then use C# instead and have you ever tried C#? If not then stfu about it.

_________________
Programming in C++
(Or at least trying to Very Happy)
Back to top
View user's profile Send private message
crayzbeef
Expert Cheater
Reputation: 0

Joined: 21 Jan 2007
Posts: 101

PostPosted: Fri Nov 28, 2008 4:29 pm    Post subject: Reply with quote

Chaosis13 wrote:
I don't care, I normally don't use VC++, I prefer Dev-C++. I just wanted to spend less time programming the interface. And I will never learn C#.


Haha, you're an ignorant twat, stop flaming C# when you don't know shit about it OR C++.
Back to top
View user's profile Send private message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Fri Nov 28, 2008 5:49 pm    Post subject: Reply with quote

o_o
well... let's see.

From String that is a number to int32
String^ text;
text = 1337;
Int32::Parse(text);

from number/byte/w/e to string
int i;
i=1337;
Convert::ToString(i);


yup. used VC++ Team System 2008 but it should work with express edition.
oh btw,
#include <windows.h>

_________________
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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