Results 1 to 4 of 4
  1. #1
    _corn_'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    0x0C482BF2
    Posts
    673
    Reputation
    13
    Thanks
    294
    My Mood
    Brooding

    Exclamation how do i convert a string to a float?

    how do i convert a string to a float in c++?

    and whats the difference between float and double?

    thanks in advance.

  2. #2
    Brimir's Avatar
    Join Date
    Oct 2011
    Gender
    male
    Posts
    357
    Reputation
    21
    Thanks
    281
    Becouse no one else will help you:

    float thefloat;
    thefloat=atof(string);

    atof - C++ Reference


    ___

    A float is not precies. if you do 10.0f/3.0f*3.0f = 9.9999999999999f
    But a float is smaller, so a double is bigger. (in memory usage)

    Type double is a floating type that is larger than or equal to type float, but shorter than or equal to the size of type long double.
    Last edited by Brimir; 12-22-2011 at 12:21 AM.
    Thanks @~FALLEN~ for helping me
    Thanks @Shakai for helping me

    Other nice ppl:
    @258456
    @giniyat101

    My usefull posts:
    Byte scanner
    How to make a logger
    Hook example
    How to make a memhack base
    How to use classes with memhacking
    Addie finder

  3. The Following User Says Thank You to Brimir For This Useful Post:

    _corn_ (12-22-2011)

  4. #3
    _corn_'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    0x0C482BF2
    Posts
    673
    Reputation
    13
    Thanks
    294
    My Mood
    Brooding
    Thanks.

    When editing memory for crossfire hacks, does it have to be a float value?
    Last edited by _corn_; 12-22-2011 at 01:10 AM.

  5. #4
    giniyat101's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    Not telling.
    Posts
    1,935
    Reputation
    130
    Thanks
    1,380
    My Mood
    Dead
    use either sprintf or atof
    only offset appears with FSTP command are float (for example shotgun spread isnt float)


     



    [img]https://i43.photobucke*****m/albums/e367/DeteSting/Steam-update.gif[/img]

Similar Threads

  1. [Help] How can i Convert sp?
    By [HP]Unique in forum Mission Against Terror Discussions
    Replies: 2
    Last Post: 08-27-2011, 12:31 AM
  2. [Discussion] how do you convert gbx to lta
    By spidermanftw in forum Combat Arms Mod Discussion
    Replies: 12
    Last Post: 07-13-2011, 07:49 PM
  3. How do you convert .iwi files to .iwd?
    By tarquin in forum Call of Duty Modern Warfare Help
    Replies: 1
    Last Post: 09-14-2010, 11:04 PM
  4. How do I convert DDS files to IWI?
    By HACKINGPIE in forum Call of Duty Modern Warfare 2 Help
    Replies: 1
    Last Post: 04-25-2010, 06:46 AM
  5. how do you convert the folder back to a .rez?
    By Divine in forum Combat Arms Discussions
    Replies: 4
    Last Post: 11-24-2009, 11:19 AM