Core Features

Variables

Learns about Cambo variables

Declaration & Initialization

Below are the basic syntax to declare and initialize a variable.

syntax
type identifier;
syntax
identifier = value;
syntax
type identifier = value;
If a variable is declared without initialization, it will be automatically set to zero or an equivalent value, such as \0, null, etc.

Basic types

In Cambo, there are many different kinds of data types, however here are some basic ones:

  • int : stores integers, whole number, such as 1975 or -1975.
  • float: stores floating point numbers, with decimals, such as 19.70 or - 19.70.
  • bool: stores values with two state: true or false.
  • char: stores single characters, such as 'A', or 'a', value A conditional statement is programming construct that executes different code depending on whether a gs are surrounded by single quote ''.
  • string: stores text, such as "Khmer", strings are surrounded by double quote "".
string is not a originally a primitive data type, it's a built-in struct in Cambo.

Example

int number = 12;
number = 99; # assign a new value

Other types:

float num = 3.14;
bool running = false;
char = 'A';
string = "hello, world!";
Copyright © 2026