If

From Game Editor

Jump to: navigation, search

Use the keyword if to check if something is true.

Here are some simple examples:

int center = 0;
if(x == 0) center = 1;
int center;
if(x == 0) center = 1;
else center = 0;
FILE *fp = fopen("myfile", "r+t");
if(fp)
{
  // your code here
}
fclose(fp);

Note that if(fp) is the same as if(fp != 0).

Note: Don't forget to have the equal signs twice.

Retrieved from "http://game-editor.com/If"