473,395 Members | 1,558 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,395 software developers and data experts.

What is while(1) loop?

What is while(1) and how it works???
Dec 12 '12 #1
4 40551
weaknessforcats
9,208 Expert Mod 8TB
while(1) is an infinite loop. You can use this to implement a function that needs to restart itself. A menu is a good example. Or a server.

No code example as this may be a homework assignment.
Dec 12 '12 #2
donbock
2,426 Expert 2GB
while(1) loops until its argument is false (zero). The integer 1 can never be zero so it loops forever.
Dec 13 '12 #3
Can you pls put your code here. That would help more.
Dec 16 '12 #4
its an infinite loop... and the statements inside it will always be executed...
Example:
while(1)
{
Statement 1;
Statement 2;
.
}
in above example these statements will be executed forever... and will never stops... You may use an "if condition" and inside it (i.e if condition) a break statement to terminate loop in some specific situation...
Dec 16 '12 #5

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

Similar topics

3
by: Anand Pillai | last post by:
This is for folks who are familiar with asynchronous event handling in Python using the asyncore module. If you have ever used the asyncore module, you will realize that it's event loop does not...
25
by: skull | last post by:
Hi everybody, it is my first post in this newsgroup. I am a newbie for python though I have several years development experience in c++. recently, I was stumped when I tried to del item of a list...
2
by: spidrw | last post by:
I have a system that lets users input service events (much like appointments at a Dr.'s office). Oftentimes a particular person will have 30 or 31 appointments in a month, as all events are...
3
by: Ben R. | last post by:
In an article I was reading (http://www.ftponline.com/vsm/2005_06/magazine/columns/desktopdeveloper/), I read the following: "The ending condition of a VB.NET for loop is evaluated only once,...
4
by: David Dvali | last post by:
What is loop continue in VB? Loke in C#: for (int i=0; i<10; i++) { if (i==7) continue; ... }
32
by: cj | last post by:
When I'm inside a do while loop sometimes it's necessary to jump out of the loop using exit do. I'm also used to being able to jump back and begin the loop again. Not sure which language my...
18
by: Derek Basch | last post by:
What is the best way to count nested loop iterations? I can only figure to use an index but that seems kludgy. index = 0 for animal in zoo: for color in animal: index += 1 Thanks, Derek...
5
by: Karyn Williams | last post by:
I am new to Pyton. I am trying to modify and understand a script someone else wrote. I am trying to make sense of the following code snippet. I know line 7 would be best coded with regex. I first...
1
by: Perl Beginner | last post by:
I hope i can articulate this question properly. i have been trying to figure this out for over a week. I am comparing the contents of two files, but the comparison is done inside of a foreach...
4
by: mrcw | last post by:
I'm trying to shorten this list Page01.Visible = False Page02.Visible = False Page03.Visible = False Page04.Visible = False Page05.Visible = False ... Page50.Visible = False
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.