Comments

Most programs require some form of commenting. Odin supports two kinds:

  • // Line comments which go to the end of the line
  • /* Block comments which go to its corresponding delimited */

    import "fmt.odin";
    main :: proc() {
        // This is an example of a line comment
        /*
        This is an example of a block comment. We suggest
        that the line comment is the preferred comment style
        however, that decision is up to you. 
            /* Block comments can be /* nested, */ */ which is
            not possible in C or C++.
      */
    
        // Block comments allow for omissions within a line of an expression
        x := 1 + /*2 + */ 3;
        fmt.println("Is `x` 4 or 6? x =", x); // Try compiling this to find out!    
    }
    

results matching ""

    No results matching ""