Else

From Game Editor

Revision as of 18:43, 25 November 2009 by Asmodeus (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

If an expression used with if is false, the part after else will be executed.

FILE *fp = fopen("myfile", "r+t");
if(fp)
{
  strcpy(text, "The file exists.");
}
else
{
  strcpy(text, "The file doesn't exixst");
}
fclose(fp);
Retrieved from "http://game-editor.com/Else"