473,468 Members | 1,369 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

What is an infinite loop?

3 New Member
what is an infinite loop?
Dec 25 '10 #1
5 2065
alexis4
113 New Member
Check this out.
Dec 25 '10 #2
Shafi hashmi
14 New Member
An infinite loop is a loop whose condition is never satisfied.
Eg.
Bool isRunning = true;
while(isRunning)
{
Console.WriteLine("running");
}
this loop will never ends (infinite loop)
Dec 25 '10 #3
Nelson Joseph
14 New Member
infinite loop never ends.
e.g
Expand|Select|Wrap|Line Numbers
  1. for(;;)
  2. {
  3. ...
  4. }
(or)

Expand|Select|Wrap|Line Numbers
  1. while(1)
  2. {
  3. }
Jan 3 '11 #4
horace1
1,510 Recognized Expert Top Contributor
when programming embedded systems infinite loops are used all the time. e.g. when switched on a river level monitoring system goes into an infinite loop checking the water level and reporting regularly.
The following is a fragment of code from a USB device (which can be connected to a PC USB port) based on a Microchip PIC24FJ64GB002 microcontroller
Expand|Select|Wrap|Line Numbers
  1.     InitializeSystem();        // initialise USB and IO devices
  2.     while(1)
  3.     {        
  4.         USBDeviceTasks();     // poll USB interface for activity
  5.         ProcessIO();        // process any device specific IO        
  6.     }
  7.  
in addition one also tends to have a watchdog timer which if the device gets into lockup state will restart the system.
Jan 4 '11 #5
ddyer
8 New Member
refer to this thread:
http://bytes.com/topic/c/answers/905...-infinite-loop
Jan 4 '11 #6

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

Similar topics

43
by: Gremlin | last post by:
If you are not familiar with the halting problem, I will not go into it in detail but it states that it is impossible to write a program that can tell if a loop is infinite or not. This is a...
5
by: mailpitches | last post by:
Hello, Is there any way to kill a Javascript infinite loop in Safari without force-quitting the browser? MP
4
by: LOPEZ GARCIA DE LOMANA, ADRIAN | last post by:
Hi all, I have a question with some code I'm writting: def main(): if option == 1: function_a()
1
by: Jim P. | last post by:
I'm having trouble returning an object from an AsyncCallback called inside a threaded infinite loop. I'm working on a Peer2Peer app that uses an AsyncCallback to rerieve the data from the remote...
5
by: Allerdyce.John | last post by:
Hi, I have this piece of code which loops thru a STL list, but that causs an infinite loop. bool Executer::group(MyList& bl, ResultList & grl) { for (ExecuterList::iterator i =...
10
by: Steven Woody | last post by:
i have a program which always run dead after one or two days, i think somewhere a piece of the code is suspicious of involving into a infinite loop. but for some reason, it is very hard to debug....
10
by: =?ISO-8859-1?Q?G=E9rard_Talbot?= | last post by:
www.authoring.stylesheets] Dear fellow CSS colleagues and web authors in alt.html discussion forum, I would like to ask you to help me confirm that there is a serious bug in IE 7 final release...
44
by: James Watt | last post by:
can anyone tell me how to do an infinite loop in C/C++, please ? this is not a homework question .
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.