C# | Sonsuz Döngü

1

1Picasso

Confirmed Memb.
Joined
Nov 20, 2019
Messages
88
Reaction score
12
Bir koşul asla yanlış olmazsa, bir döngü sonsuz döngü haline gelir. For döngüsü geleneksel olarak bu amaç için kullanılır. For döngüsünü oluşturan üç ifadeden hiçbiri gerekmediğinden, koşullu ifadeyi boş bırakarak sonsuz bir döngü oluşturabilirsiniz.

C#:
 class Program {
      static void Main(string[] args) {
         for (; ; ) {
            Console.WriteLine("Hey! I am Trapped");
         }
      }
   }

Koşullu ifade olmadığında, doğru olduğu varsayılır. Bir başlatma ve artırım ifadesi de kullanılabilir, ancak programcılar sonsuz bir döngüyü belirtmek için for yapısını daha çok kullanırlar.
 
SPAM IS FORBIDDEN!
  • SPAMMERS ARE BANNED FROM THE FORUM AND CANNOT USE ANY OF THE CHEATS
  • For example: thanks, thx, very good, asdqwe, working, ty and so on!
  • For example: Writing the same message over and over. thanks, thx and so on!
  • Copying and copying someone else's message is prohibited.
  • It is forbidden to send messages to increase the number of comments on threads that you have no knowledge of.
  • Write your own opinion when commenting!
  • If you see spam message, please let us know with the REPORT button!

Tema düzenleyici

Top Bottom