| View previous topic :: View next topic |
| Author |
Message |
blackmorpheus Expert Cheater
Reputation: 0
Joined: 05 Apr 2008 Posts: 159
|
Posted: Wed Nov 26, 2008 3:38 pm Post subject: |
|
|
int value = 8;
char buffer[1000];
sprintf(buffer, "%i", value);
string will be stored in buffer.
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Wed Nov 26, 2008 8:43 pm Post subject: |
|
|
| itoa
|
|
| Back to top |
|
 |
Zand Master Cheater
Reputation: 0
Joined: 21 Jul 2006 Posts: 424
|
Posted: Wed Nov 26, 2008 8:51 pm Post subject: |
|
|
| 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 |
|
 |
Zerith Master Cheater
Reputation: 1
Joined: 07 Oct 2007 Posts: 468
|
Posted: Thu Nov 27, 2008 5:50 am Post subject: |
|
|
| 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 |
|
 |
ssaccount Master Cheater
Reputation: 0
Joined: 29 Aug 2007 Posts: 391 Location: Finland
|
Posted: Thu Nov 27, 2008 7:41 am Post subject: |
|
|
| 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 ) |
|
| Back to top |
|
 |
crayzbeef Expert Cheater
Reputation: 0
Joined: 21 Jan 2007 Posts: 101
|
Posted: Fri Nov 28, 2008 4:29 pm Post subject: |
|
|
| 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 |
|
 |
hacksign23 Master Cheater
Reputation: 0
Joined: 26 Nov 2006 Posts: 404
|
Posted: Fri Nov 28, 2008 5:49 pm Post subject: |
|
|
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 |
|
 |
|