Re: Function Overloading
Pramod wrote:
On Jun 14, 5:32 pm, Erik Wikstr?m <eri...@student.chalmers.se> wrote:
On 14 Juni, 14:24, Pramod <sahgalpram...@gmail.com> wrote:
On Jun 14, 5:10 pm, Amal P <enjoyam...@gmail.com> wrote:
On Jun 14, 9:05 pm, Pramod <sahgalpram...@gmail.com> wrote:
I have one question. Can I catch exception in function
overloading.In my programm i want to create two function with
same signature and same return type. I know its not
possible...can i use try.catch .block to hand this exception.
Dear Pramod,
Function overloading happens in compile time.
Exception handling is during runtime.
So you can mix these thing together.
I think I answered your question. If not can you just make your
question more clear?
Thanks and regards,
Amal P
ya amal
can i write my code like this
void sum(int,int)throw;// 1st function
void sum(float,float)throw;//2nd function
Sure, but what are the exceptions for? If the types of the parameters
are different then the compiler will choose the function to call
based on the arguments provided.
--
Erik Wikstr?m- Hide quoted text -
- Show quoted text -
ya you are write basically i wrote wrong ....right question is
int sum(int,int)throw;// 1st function
void sum(int,int)throw;//2nd function
Uh... Sorry, I must be dumb or something... What is the *question*?
You just repeated the declarations you showed above with a very slight
variation. What do exceptions have to do with it? From your original
post:
Can I catch exception in function
overloading.
What does that mean? What's "exception in function overloading"? Or
what does it mean to "catch" something in "function overloading"?
Please elaborate. Perhaps use less fancy words...
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask