Odin Quickstart Reference

← Back to quick reference

← Home

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Quick reference guide for Odin. Essential syntax, types, control flow, and common patterns for the Odin programming language.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Hello World

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Variables

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Control Flow

If/Else

For Loops

While Loops

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Functions

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Arrays / Slices

Slices

Arrays

Maps

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Strings

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Structs

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Enums

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Unions

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Error Handling

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

File Operations

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Memory Management

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Tips

import "core:fmt"

import "core:os"

input: [256]u8

n, _ := os.read(os.stdin, input[:])

text := string(input[:n])