Infinite loops C++ Implementation

If you are undertaking any embedded software development, it’s crucial that you understand how to write infinite loops. Implementing infinite loops in c++ is actually a piece of cake and I’ll show you three examples that do the job. Keep in mind that infinite loops repeat indefinitely with no terminating condition, so use them wisely.


// While Loop Infinite Loop
while (1)
{

}


// For Lopp Infinite Loop
for (;;)
{
}

</pre>
// Do While Infinite Loop
do
{

}
while (true)