Leak Society - The Home Of Nulled Resources.
Forum Beta v1 Now Live!
C/C++
Thead Owner : Kurt Manion, Category : Everything Coding, 14 Comment, 462 Read
Viewers: 2 Guest(s)
Member
***
167
Messages
19
Threads
0
Rep
4 Years of Service
08-16-2011, 04:09 PM
#6
tut2: defining your variables

this is a simple, yet important concept:
variables must be defined before use, and it attributes the amount of data they'll use, and hoe they'll be treated by the compiler.
this is a quick run-down of all of them,  and will still explain them as they're used in future tutorials

int - as in integer, a number that ranges from -32768 to 32767 these numbers should be familiar to any GM user.
thats because both int, and the standard numerical variable on GM use two bytes of information to stare the data. int stands for integer.

unsigned - the same as integer, but it can only be positive (or zero) to the range is farther 0 - 65535 is also a modifyer

char - a character value that is stored in the computers information as ASCII, and therefore we can use mathematical expressions on it.
it only hold one character

float - as in floating point integer. can also be expressed as double which gives it "double accuracy" and long(explained below)

short/long - these are modifiers, so you would write short or long before int, unsigned, or float
for int it'd be -21474836 to 21474835 it only allocates two more bytes of data(4 total) and the increase is so large because it's expressed in binary which is in base 2, and exponentially based (<<you shouldn't understand that cocept yet. I'll explain it at the bottom of this) exponential
for short is the default

signed - also a default it's for int, float, and double


Messages In This Thread
C/C++ - by Kurt Manion - 08-12-2011, 12:35 AM
C/C++ - by Taz - 08-13-2011, 07:57 PM
C/C++ - by Gan - 08-13-2011, 08:16 PM
C/C++ - by Kurt Manion - 08-14-2011, 12:57 PM
C/C++ - by Kurt Manion - 08-14-2011, 12:59 PM
C/C++ - by Kurt Manion - 08-16-2011, 04:09 PM
C/C++ - by Kurt Manion - 08-16-2011, 04:10 PM
C/C++ - by Kurt Manion - 08-16-2011, 04:16 PM
C/C++ - by Kurt Manion - 08-16-2011, 05:06 PM
C/C++ - by Kurt Manion - 08-27-2011, 11:08 PM
C/C++ - by Kurt Manion - 09-04-2011, 09:01 PM
C/C++ - by Kurt Manion - 09-05-2011, 03:38 PM
C/C++ - by Kurt Manion - 09-08-2011, 09:00 PM
C/C++ - by Kurt Manion - 09-19-2011, 09:57 PM
C/C++ - by Kurt Manion - 09-22-2011, 10:49 PM

Forum Jump: