Member Avatar for Rebecca_t

why should we use an infinite while loop?

Whenever the "code" itself does not determine when the routine exits.
It could be waiting on user input or the input from another thread or process before it breaks.
Here is an article.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.