Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,666 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,148 people online right now. Registration is fast and FREE... Join Now!




A very quick question

 
Reply to this topicStart new topic

A very quick question, Easy for you to answer

12ob0t
post 9 Jun, 2007 - 01:31 PM
Post #1


New D.I.C Head

*
Joined: 9 Jun, 2007
Posts: 1


My Contributions


I play this game, I am trying to get enemy UID number, it gives it to me in hex. I am having trouble converting this to hex to a decimal automatically.

CODE
        DWORD enemy[1];
        memcpy(enemy,(DWORD*)0x00548382,sizeof(DWORD));
                char ok[101];
        sprintf(ok,"%.08X",enemy[0]);
        Print(ok);
        }


Print is a function I coded that works just like printf.

Can anyone help me display it in decimal and not hex?

This post has been edited by 12ob0t: 9 Jun, 2007 - 01:32 PM
User is offlineProfile CardPM

Go to the top of the page

Amadeus
post 9 Jun, 2007 - 04:47 PM
Post #2


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,178



Thanked 33 times

Dream Kudos: 25
My Contributions


http://www.dreamincode.net/code/snippet882.htm
User is online!Profile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/23/08 05:52AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month