By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,514 Members | 1,741 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,514 IT Pros & Developers. It's quick & easy.

Declaring a non-void functions

P: 2
Hello Sir/Madam,
I had declared a function as a non-void type as shown below:

uinsigned int functn(int x, int y);

While using this function in my program, I am getting the warning as
"control reaches end of non-void function". For this, any solution is there to eradicate this warning please intimate me.

Thanking you,

Hemanth Kumar P
May 28 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 10K+
P: 11,448
Hello Sir/Madam,
I had declared a function as a non-void type as shown below:

uinsigned int functn(int x, int y);

While using this function in my program, I am getting the warning as
"control reaches end of non-void function". For this, any solution is there to eradicate this warning please intimate me.

Thanking you,

Hemanth Kumar P
For any non-void function every branch of every possble flow control should end
with a return statement. If you don't supply return statements in your function
better make it a void function then.

kind regards,

Jos
May 28 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.