Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Need help with C++

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Benji
Random spam moderator
Reputation: 4

Joined: 31 Dec 2007
Posts: 61
Location: The Netherlands

PostPosted: Mon Aug 03, 2009 9:28 am    Post subject: Need help with C++ Reply with quote

What is the difference between Float, String, Char, Int, Signed, Unsigned, Shorts and Longs? The tutorial is very unclear about them and the only thing I can understand from it is that they can hold a certain capacity of numbers.

Also, not just their meanings. I'd like a full explanation. Will +REP.

_________________


Last edited by Benji on Mon Aug 03, 2009 10:16 am; edited 3 times in total
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Mon Aug 03, 2009 9:35 am    Post subject: Reply with quote

they're different data types

float = non-integer
string = look it up.. i'm not even going to explain that one
char = character.. ?
int = integer
signed = can be negative
unsigned = positive/0
Back to top
View user's profile Send private message
DURAN
Newbie cheater
Reputation: 14

Joined: 19 Apr 2007
Posts: 16
Location: The Netherlands

PostPosted: Mon Aug 03, 2009 9:44 am    Post subject: Reply with quote

where's the cp?
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Mon Aug 03, 2009 9:48 am    Post subject: Reply with quote

Refer to this http://en.wikipedia.org/wiki/Integer_(computer_science)

This is what char looks like in the memory
Code:
00402258  6C 6F 6C 6F 6C 6F 6C 6F 6C 00                    lolololol.


This is what string looks like in the memory
Code:
0013FF14  6C 6F 6C 6F 6C 6F 6C 6F 6C 00                    lolololol.


Not much, but both of them have a \0 terminator... Correct me if I'm wrong but, string is used only in C++ because C++'s iostream lib.

If you want to use integers above long(signed or unsigned), you could do...

Code:

unsigned long long wat = 84793292932432432;
signed long long wat = -84793292932432432;
Back to top
View user's profile Send private message
Jonyleeson
Master Cheater
Reputation: 0

Joined: 03 May 2007
Posts: 484
Location: Hérault, France

PostPosted: Mon Aug 03, 2009 9:53 am    Post subject: Reply with quote

; wrote:

This is what char looks like in the memory
Code:
00402258  6C 6F 6C 6F 6C 6F 6C 6F 6C 00                    lolololol.

No, that's what an array of chars, also known as a string, looks like in the memory. A char itself is just a signed byte.

_________________
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Mon Aug 03, 2009 9:55 am    Post subject: Reply with quote

Jonyleeson wrote:
; wrote:

This is what char looks like in the memory
Code:
00402258  6C 6F 6C 6F 6C 6F 6C 6F 6C 00                    lolololol.

No, that's what an array of chars, also known as a string, looks like in the memory. A char itself is just a signed byte.
That's what I meant.
Back to top
View user's profile Send private message
Benji
Random spam moderator
Reputation: 4

Joined: 31 Dec 2007
Posts: 61
Location: The Netherlands

PostPosted: Mon Aug 03, 2009 10:17 am    Post subject: Reply with quote

So why wouldn't you always use a long int or w/e? And what are they actually good for?
_________________
Back to top
View user's profile Send private message
Ind3siszive
Cheater
Reputation: 0

Joined: 23 Apr 2009
Posts: 43
Location: in a glitch

PostPosted: Mon Aug 03, 2009 10:51 am    Post subject: Reply with quote

you need to look at this

http://www.cplusplus.com/doc/tutorial/variables/

_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Mon Aug 03, 2009 10:52 am    Post subject: Reply with quote

Benji. wrote:
So why wouldn't you always use a long int or w/e? And what are they actually good for?
http://www.programmersheaven.com/user/pheaven/blog/191-Float-Double-and-Decimal-do-you-know-the-differences/
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Mon Aug 03, 2009 1:33 pm    Post subject: Reply with quote

Quote:
What is the difference between Float, String, Char, Int, Signed, Unsigned, Shorts and Longs? The tutorial is very unclear about them and the only thing I can understand from it is that they can hold a certain capacity of numbers.


Float.

Contains a "floating" decimal point - used for exact measurements for things such as 3D rendering in DirectX, OpenGL, etc.

While setting these you typically append an "f" to the number.

__________________________________________________________

Char.

A single byte in memory (BYTE is typedef'd as an unsigned char), ranging from 0-255 (0x0 - 0xFF). Can store regular numbers as bytes, or ASCII characters whose values will be stored. Most common disassemblers/memory editors/hex viewers will show you this ASCII in plain text.

___________________________________________________________

String.

A C++ container that is basically used to handle a series of char's, ending with a NULL-terminated character (aka "\0").

The object has special functions that make it easier to manipulate itself, as opposed to simple char buffers, which need the basic "str"-funcs to handle it. (or just plain byte value changing by yourself).

___________________________________________________________

Int.

A regular int will usually be automatically signed. Integers hold number values in memory.

Signed (have a "sign" such as negative or positive) = –2147483648 to 2147483647
Unsigned (can only be positive) = 0 to 4294967295

Same range size, but not the same range.
Integers are typically 4 bytes, although it depends what system you run on.

___________________________________________________________

Long.

4 bytes, aka DWORD.

Unsigned long or signed long = unsigned int or signed int.

___________________________________________________________

Short.

Only 2 bytes, aka WORD.

Ranges:

signed short = –32768 to 32767
unsigned short = 0 to 65535
Back to top
View user's profile Send private message
Benji
Random spam moderator
Reputation: 4

Joined: 31 Dec 2007
Posts: 61
Location: The Netherlands

PostPosted: Mon Aug 03, 2009 5:06 pm    Post subject: Reply with quote

Ind3sisziver wrote:
you need to look at this

http://www.cplusplus.com/doc/tutorial/variables/

I'm following that exact tutorial, but I'm not English so I have a trouble understanding the meanings.

smartz993 wrote:

Sorry, but you will have to wait 36658 seconds before you can give rep
Thank you Very Happy

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites