Re: Help with a little C

new topic     » goto parent     » topic index » view thread      » older message » newer message

|>Subject:      Re: Help with a little C
|>>I need a little help with just what this line of code does
|>>
|>>boolean G_CheckDemoStatus (void);
|>>
|>>i know what boolean means in math but what does it do here???
|>>


The following 'C' statement:

boolean G_CheckDemoStatus (void);

 when translated into English would be something like:

There is a function called "G_CheckDemoStatus" that takes no parameters and
returns a "boolean" data type.

However, there is no native data type of boolean in 'C', so my guess is that
there is an earlier line of code (maybe contained in an "include" file) that
defines what the code author meant by "boolean".

Maybe something like:
  #define boolean int

which means that boolean is an alias for "int", an integer.

It is a common convention in 'C' programming to return an integer with a
value of zero to mean "false" and non-zero (often -1) to mean true.


cheers,
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu