Technology Software

How to Make the Shortest Code for an Infinite Loop

    • 1). Find the place in code where you want to place the infinite loop. Sometimes there may be a large chunk of code you want running infinitely, while other times it may just be a location in a program. Any code that is written after an infinite loop will not run.

    • 2). Choose the type of statement you wish to use to create an infinite loop. You could want to use a do-while loop or a for statement. Regardless of which statement you choose, it can be done with one line of code.

    • 3). Determine which programming language to use. Most languages have similar ways of doing the same thing, but syntax will be unique to the language.

    • 4). Create the statement. A do-while loop can be written as while(true){}; in C++. Similarly, in C++ you could write a for loop as for(float i = 0; i != 1.1; i++){}. Either line of code creates an infinite loop in the program, causing your program to run until manually exited.

Related posts "Technology : Software"

How to Capture Analog Audio on My Computer

Software

Effective Photoshop Training Course to Enhance Your Photos

Software

How To Use Softphone Software For Your Business

Software

How to Access a String Array in JSP

Software

How Do I Get a Reversible Reaction Arrow in Microsoft Word 2007?

Software

How to Get AVCHD (MTS) Files to My PC

Software

Beat Detective Region Conform Tips

Software

MS BKF Repair Tool to Fix Corruption Owing to FAT File System

Software

Making an ASM Comparison

Software

Leave a Comment