Page 1 of 1

Global Vars

PostPosted: Sat Apr 24, 2004 10:55 am
by ingsan
Please excuse me with this silly question :oops: I've always worked with Global integer variables and never felt the Need to ask myself about Local Vars, real vars and String ... I never attended any C training and learned the few things I know by myself :cry: So I know I'm missing a lot.
If someone ... anyone could spend some time explaining to me the difference among all these. I really want to structure my codes and go right to the point instead of doing some approximate things. Please help :cry:

PostPosted: Sat Apr 24, 2004 11:07 am
by jazz_e_bob
Local Vars are good for things like "mass" or "health" or "playerNickName".

Once you declare "health" as a local var every actor will have its own "health" property.

Global Vars are good for things like "gravity" or "gameIsOver" or "highestScore".

DATA TYPES
Integers (non-decimal numbers)
Real (decimal numbers)
String (word(s))

Image

PostPosted: Sat Apr 24, 2004 11:24 am
by ingsan
You'r ethe MAN ! 8)
Thank you so much for your precious help. Now I can see the light :idea:
:o