User Variable Types

Game Editor comments and discussion.

User Variable Types

Postby rokstar553 » Mon Apr 07, 2008 5:18 am

Whats the difference between Integer, Real and String variables?
rokstar553
 
Posts: 5
Joined: Sat Dec 01, 2007 10:58 pm
Score: 0 Give a positive score

Re: User Variable Types

Postby DilloDude » Mon Apr 07, 2008 6:01 am

An integer is like a whole number, with negatives. So it can be ...-2, -1, 0, 1, 2... and so on.
A real number contains decimals, so it can have fractions: 0.031, 192.6, 10.5 etc.
A string is a list of text or some such. So it can be "Hello!", "Bob" or something like that.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Re: User Variable Types

Postby rokstar553 » Mon Apr 07, 2008 6:10 am

Thanks :D
rokstar553
 
Posts: 5
Joined: Sat Dec 01, 2007 10:58 pm
Score: 0 Give a positive score

Re: User Variable Types

Postby Fuzzy » Mon Apr 07, 2008 10:36 am

a string is really a array of type char, which is an 8 bit number from -128 to 127. It is often used to represent characters, which is where "char" comes from.

So in ge you make a string like so

char name[howmany];
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron