This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Function parameter

Hi All,
I am newbie in this. Is this function declaration right, as it has bit as parameter,
void myfunc(unsigned char,bit);

Ashutosh

Parents
  • Is it - even with 'bit' ?

    However, the fact that it's syntactically valid in isolation doesn't mean that it is "right".

    To be "right" means that the declaration has to match the definition. As we have no idea what the definition is, the balance of probabilities that one declaration matches one of the infinite space of possible definitions must be vanishingly small. So "No" is the most-likely-correct answer...

    ;-)

Reply
  • Is it - even with 'bit' ?

    However, the fact that it's syntactically valid in isolation doesn't mean that it is "right".

    To be "right" means that the declaration has to match the definition. As we have no idea what the definition is, the balance of probabilities that one declaration matches one of the infinite space of possible definitions must be vanishingly small. So "No" is the most-likely-correct answer...

    ;-)

Children
  • Is it - even with 'bit' ?

    Good catch!

    Your original post was a perfectly correct answer to the OP's question. If he'd asked a different question, your answer would have been wrong - nonetheless, the code he posted is standard 'C' (this time with the proviso that it uses implementation specific extensions as permitted by the standard).

    Did I get away with that?