while true loop infinity



In C++...
#include 
using namespace std;

int main() {
    int test = 10;
    while(test == 10) {
        cout << test;
    }
}
In golang...
package main
import "fmt"

func main() {
    test := 10
    for test == 10 {
        fmt.Println(test)
    }
}

2 comments:

  1. Wow ! So much internet in this picture ! Not sure if i'll manage to actually look at the code soon.

    ReplyDelete
  2. Actually, instead of that, you could do:

    for {
    fmt.Println(test)
    }

    If you need help learning Go, reference the Go by Example website.

    ReplyDelete