Page 1 of 1

elaborate

Posted: May 12th, 2012, 6:57 pm
by Pharoah
what do you mean by if the statment is true or false what does that mean?
and why do you insert { } these alot r they needed if so what do they do?
;) thanks

Re: elaborate

Posted: May 12th, 2012, 7:13 pm
by LuX
If statement looks up if the statement inside () is correct or incorrect; true or false.
the {} just points out the program from where to what you want it to do something.

Example:

Code: Select all

int a = 1;
int b;
int c;

if (a == 1)     // Asks if 'a' is '1'
{
    b = 2; // If 'a' is '1' then do this
}
else
{
    c = 4;     // But if 'a' is not 1; if it's anything else but '1', do this
}
In English that says:
"If 'a' is 1, then do whatever is between {}, but else, if 'a' is not 1, then do what ever is between the next {}"

Re: elaborate

Posted: May 12th, 2012, 10:37 pm
by magusofmirrors
I believe you should learn regular C++ programming first before tackling game programming. Go look at cplusplus.com 's tutorials. They teach C++ and programming pretty well there.

Edit: I see there are "regular C++ tutorials". I thought this was the link to regular programming to graphics and stuff. Guess I'll have to wait for that. Silly me.

Re: elaborate

Posted: May 13th, 2012, 8:09 am
by chili
Yeah, the series I'm working on right now is a beginner C++ series. The only difference between this and other intro series is that this one starts off with a graphics framework instead of starting out using console/iostream/stdio calls.