| |
|
XlegoX
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 14955 |
|
|
| 21 May 2009 08:29 AM |
What do you mean?
The number is allways the same thing in memory, regardless what base you view it in, you don't *need* to convert bases. |
|
|
| Report Abuse |
|
|
|
| 21 May 2009 08:34 AM |
"189647" --> "2E4CF"
And
"2E4CF" --> "189647" |
|
|
| Report Abuse |
|
|
XlegoX
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 14955 |
|
|
| 21 May 2009 08:34 AM |
| As I said, why do you need to convert them?, they allready represent the exact same value in memory! |
|
|
| Report Abuse |
|
|
|
| 21 May 2009 08:36 AM |
| I'm making a number converter... |
|
|
| Report Abuse |
|
|
XlegoX
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 14955 |
|
|
| 21 May 2009 08:38 AM |
Oh, so you want to know how to display a number in a specific chosen base in the output?
#include < iostream > std::cout << std::ios::setbase(16) << a_number << "\n";
I think ios::setbase is the function you want, try that. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 21 May 2009 11:02 AM |
| *gasp* how could you say that!!!! *Chanting* Heratic! Heratic! Heratic! *Chanting* |
|
|
| Report Abuse |
|
|
Clone512
|
  |
| Joined: 02 Mar 2008 |
| Total Posts: 7810 |
|
|
| 21 May 2009 11:39 AM |
| "python pwns c++", python is crappy, for your information. |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 21 May 2009 12:48 PM |
| ((Lua > Python) < C++) > Every other language > Microsoft Visual ANYTHING |
|
|
| Report Abuse |
|
|
bobob55
|
  |
| Joined: 24 Jul 2008 |
| Total Posts: 4522 |
|
|
| 21 May 2009 02:48 PM |
@dr01d3k4
Very true except for SQL you need that |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
| |
|
bobob55
|
  |
| Joined: 24 Jul 2008 |
| Total Posts: 4522 |
|
|
| 21 May 2009 02:50 PM |
| (((Lua > Python) < C++) > SQL) > Every other language > Microsoft Visual ANYTHING |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
| |
|
XlegoX
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 14955 |
|
|
| 21 May 2009 02:56 PM |
| You can get SQL SDK's for C++... |
|
|
| Report Abuse |
|
|
sdfgw
|
  |
 |
| Joined: 08 Jan 2009 |
| Total Posts: 41681 |
|
|
| 21 May 2009 03:03 PM |
This is probably me not no-one anything again XD
base(10, 16, number)
If hexidecimal is base 16... |
|
|
| Report Abuse |
|
|
bobob55
|
  |
| Joined: 24 Jul 2008 |
| Total Posts: 4522 |
|
|
| 21 May 2009 03:04 PM |
| What about something with DOS |
|
|
| Report Abuse |
|
|
pearman
|
  |
| Joined: 05 Jun 2009 |
| Total Posts: 1681 |
|
| |
|