473,408 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

What does return mean here ?!

if(current==NULL)
{
cout<<"Can't find the element to be deleted " <<endl;
return;
}
Jan 6 '11 #1
10 5909
Rabbit
12,516 Expert Mod 8TB
It means exit the function.
Jan 6 '11 #2
and what will be the difference if i put "break;" ?!
Jan 6 '11 #3
and and this snippet it's kinda useless,isn't it ?!
it does the job when there are other statements,yeah ?!
Jan 6 '11 #4
and what will be the difference if i put "break;" ?!

and in this snippet it's kinda useless,isn't it ?!
it does the job when there are other statements,yeah ?!
Jan 6 '11 #5
Rabbit
12,516 Expert Mod 8TB
Break exits the innermost flow control structure. In this case, break exits the if statement. Yes, break would be pointless in that statement. Return would not depending on what you're trying to do. I have no idea what you mean by that last line.
Jan 6 '11 #6
Haha,never mind,it was a stupid question.
Let me be sure that i got it,,return exit the function,but break get me out of the conditions and jumps to the code after it ,right ? :$
Jan 6 '11 #7
Rabbit
12,516 Expert Mod 8TB
That's right. But in the case of breaks, it only breaks out of one control flow. If you had a loop in a loop, it only breaks out of the inner most loop.
Jan 6 '11 #8
Thanks a lot ! =)
Jan 6 '11 #9
donbock
2,426 Expert 2GB
break will exit from the innermost switch, for, do, or while block. Think of it as a goto the first statement after the block. It has nothing to do with if statements. It is an error to use break if not within a switch, for, do, or while block.
Jan 6 '11 #10
Rabbit
12,516 Expert Mod 8TB
Sorry, my mistake. It's been a while since I've used C. Don's right. I guess there really isn't a need to break out of an if statement.
Jan 6 '11 #11

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

Similar topics

0
by: Andrey Mishenin | last post by:
While accessing MySQl data base by means of perl the value of variable $! sometimes equals " Resource temporarily unavailable". At the mean time everything works correct. What does that mean?...
4
by: David | last post by:
Hi, Buddy, a newbie's question for you guys, In C++, some functions have a return value type "result", what does this mean, I searched on web, but no hint. thanks a lot David
2
by: pembed2003 | last post by:
Hi all, I recently saw a piece of code that looks like: class one{public: one(){} }; class two : public virtual one{public: two(){} }; class three : virtual public one{public: three(){} }; ...
6
by: **Developer** | last post by:
What does this mean: External component has thrown an exception. My program crashes after it leaves a subroutine. What I see during debugging is when I press F11 at the End Sub statement
10
by: tony | last post by:
Hello!! I have some demo programs written in C# and they have this construction "" see below. I haven't seen this before so what does it mean ? public bool ShowDropDownButtons { get {...
3
by: Ant | last post by:
Hi, I'm wondering what this exactly means when I see it describing class in MSDN. "Any instance members are not guaranteed to be thread safe." What does this mean exactly & how could an "un...
9
by: JoeC | last post by:
m_iWidth = (int)pBitmapInfo->bmiHeader.biWidth; m_iHeight = (int)pBitmapInfo->bmiHeader.biHeight; What does this mean? I have seen v=&var->member.thing; but what does it mean when you...
0
by: steve | last post by:
What does it mean to set a value or April fools all year long :) http://beyondsql.blogspot.com/2008/03/sql-what-does-it-mean-to-set-value.html
14
by: Tony | last post by:
Hello! It says "Another limitation that you need to be aware of is that using the operator == and != are only permitted when comparing a value of a type supplied to a generic type to null....
1
by: rasmidas | last post by:
Hi, Could anyone please let me know what does it mean by the following statement in solaris shell scripting. $PROMPT " Select an option: " read ans db_option=${ans:=0} I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.