passing an enum type in a function call

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nano2
    New Member
    • Jan 2007
    • 41

    passing an enum type in a function call

    hi,
    Have the following scenario can you see why this crashes when calling this function check below ?

    enum operatortypes oper;
    check_op(oper);


    void check(enum operatortype op){

    }
  • nickyeng
    Contributor
    • Nov 2006
    • 252

    #2
    because check(xx) is not check_op(xx) ?!?!?!?

    Comment

    • AdrianH
      Recognized Expert Top Contributor
      • Feb 2007
      • 1251

      #3
      Originally posted by nickyeng
      because check(xx) is not check_op(xx) ?!?!?!?
      No, in that case this wouldn't even compile. Though there is no main() either so...

      :)

      Adrian

      Comment

      Working...