• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Results 1 to 5 of 5
    1. #1
      Jr.Coder
      C# All the way!
       
      At Work
       
      Elertan's Avatar
      Join Date
      Mar 2013
      Location
      Everywhere!
      Posts
      84
      Thanks (-->)
      4
      Thanks (<--)
      1

      Input cin to a hexadecimal integer C++

      John Kittz
      Hey guys, small issue!

      Lets say i have got this:

      int Address = 0x0234A230;


      When i use this the program runs fine but if i want the user to input the Address the output would be 0.

      int Adress;
      cout << "Please enter a hexadecimal address (With 0x0): " << endl << endl;
      cin >> Address;
      cout << endl << endl << "The entered address: " << Adress << endl;


      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^
      The output will be zero, adding the address to a string and converting it then also gives a 0.

      Anyone got a solution for this?

      Thanks, Elertan

    2. #2
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      kaz's Avatar
      Join Date
      Apr 2013
      Posts
      166
      Thanks (-->)
      41
      Thanks (<--)
      49
      You have Address
      and when you use cout you did Adress

    3. #3
      Hacker
      Turning to page 394...
       
      Coding
       
      Liduen's Avatar
      Join Date
      May 2013
      Location
      Germany
      Posts
      713
      Thanks (-->)
      161
      Thanks (<--)
      225
      As far as I know you have to put an "hex" before, but that's not the entire solution for your problem:
      cout << hex << nYourInteger << endl;
      My contributions
      UrbanTerror | OpenGL - ModelLogger | Polymorphic junk code | Tutorial/Article Collection
      Admiring technological singularity

    4. #4
      The Angel Of Verdun
      Always More To Code!
       
      Lurking
       
      Nether's Avatar
      Join Date
      Dec 2013
      Location
      England, SW
      Posts
      299
      Thanks (-->)
      54
      Thanks (<--)
      186
      Quote Originally Posted by EleRtan View Post
      Hey guys, small issue!

      Lets say i have got this:

      int Address = 0x0234A230;


      When i use this the program runs fine but if i want the user to input the Address the output would be 0.

      int Adress;
      cout << "Please enter a hexadecimal address (With 0x0): " << endl << endl;
      cin >> Address;
      cout << endl << endl << "The entered address: " << Adress << endl;


      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^
      The output will be zero, adding the address to a string and converting it then also gives a 0.

      Anyone got a solution for this?

      Thanks, Elertan
      You had Adress & Address (difference being spelling - don't know if this was a forum typo or C&P from your source), and as said before you need to declare output as hex [use this output {hex} locally, never globally as all your outputs will be in hex]
      You can also use this on cin(input) as far as i know so you don't need to input 0x0.... etc just the address.

      DWORD Address = 0; //Initialize Variable
      cout << "Enter Address: "; //Don't End Line - Cleaner Formatting
      cin >> hex >> Address; //Input Hex On Same Line As (Enter Address: _ )
      cout << "\nThe Entered Address Is: " << hex << Address; //Output the result on a new line (/n)
      Last edited by Nether; 02-21-2014 at 04:16 PM.
      No Need For Anything Extravagant, Your Blood As A Present Shall Suffice.

    5. #5
      Jr.Coder
      C# All the way!
       
      At Work
       
      Elertan's Avatar
      Join Date
      Mar 2013
      Location
      Everywhere!
      Posts
      84
      Thanks (-->)
      4
      Thanks (<--)
      1
      Cheats'n'Trainers
      Quote Originally Posted by Nether View Post
      You had Adress & Address (difference being spelling - don't know if this was a forum typo or C&P from your source), and as said before you need to declare output as hex [use this output {hex} locally, never globally as all your outputs will be in hex]
      You can also use this on cin(input) as far as i know so you don't need to input 0x0.... etc just the address.

      DWORD Address = 0; //Initialize Variable
      cout << "Enter Address: "; //Don't End Line - Cleaner Formatting
      cin >> hex >> Address; //Input Hex On Same Line As (Enter Address: _ )
      cout << "\nThe Entered Address Is: " << hex << Address; //Output the result on a new line (/n)
      You and Liduen this is what i was searching for, thx for replying to my thread! And yes the second Adress was my spelling
      Last edited by Elertan; 02-21-2014 at 05:39 PM.

    Similar Game Hacker Threads

    1. [Off Topic] Count to 3E8 in Hexadecimal
      By [GH]Rake in forum Off Topic
      Replies: 66
      Last Post: 12-10-2016, 06:42 PM
    2. [Help] Clearing the user input
      By tvojama in forum C/C++
      Replies: 5
      Last Post: 02-29-2016, 01:06 AM
    3. Windows console not accepting input
      By tvojama in forum C/C++
      Replies: 11
      Last Post: 09-07-2015, 08:48 AM
    4. [Help] How find IInput * input for connect CUserCmd * cmd ?
      By mihas404 in forum Hacking Help
      Replies: 10
      Last Post: 02-19-2014, 08:11 PM
    5. C++ CSS Aimbot help/input/suggestion
      By Caleb41610 in forum C/C++
      Replies: 2
      Last Post: 09-29-2013, 05:06 PM

    Tags for this Thread