Link to home
Create AccountLog in
Avatar of Roni
Roni

asked on

How do functions evaluate arguments?

I just want to know if I am on the right path.  The function will evaluate an argument like an error check?  Say for instance, if you are suppose to have numeric - it will evaluate the input whether it is numeric or alpha?  I am very confused with this.  I am just a beginner in C++, taking a class thorugh work and they did not have such good explainations on this subject enough for me to understand it.
ASKER CERTIFIED SOLUTION
Avatar of Axter
Axter
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Roni
Roni

ASKER

Can you give me an example?  I am still not understanding - so you are saying it does work like an error handler?
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
>>so you are saying it does work like an error handler?

At compile time, yes.
But that's if you don't use explicit casting, as in jkr's example.

In general, you should avoid casting, because you're removing the compiler's ability to catch errors at compile time.
Avatar of Roni

ASKER

Thank you very much.  In reading your explainations and researching more, I now understand......thank you both again....
Avatar of Roni

ASKER

Okay....how do I change it?  
Avatar of Roni

ASKER

Thank you.....