1: Do we need to follow the same rules for function names as for the variables?

2: I have always noticed there is no space between the function name and the parentheses, e.g. func(). But I have just experimented and found that having a space between the function name and parentheses doesn't make a difference. Correct? Perhaps, it's considered non-standard.

There are also reserved identifiers. The standard reserves all identifiers prefixed with double underscore or an underscore followed by an uppercase letter (in any scope) and all prefixed with underscore only (in the global scope). IIRC there are others like these beginning with SIG (for signal codes).

05-14-2011

CommonTater

Quote:

Originally Posted by jackson6612

Hi

1: Do we need to follow the same rules for function names as for the variables?

In addition to kmdv's very informative response...
Yes, follow the same rules... use function names that make sense, keep them terse but not undescriptive of their function, try to spell things correctly.

Quote:

2: I have always noticed there is no space between the function name and the parentheses, e.g. func(). But I have just experimented and found that having a space between the function name and parentheses doesn't make a difference. Correct? Perhaps, it's considered non-standard.

I use a space all the time... I find it much more readable that way (but then the rest of my coding style is a bit unortodox as well)

I don't like the fact that the braces are at the same lines as the code. IMO, you should use a style closer to Allman or K&R. This is obfuscation.
Regarding the paranthesises... it's just whitespace. The compiler ignores it.