Skip to content

Latest commit

 

History

History

constants

Constants in Go

Types of const(s)

  • Typed
  • Untyped (Kind)

Facts about constants

  • Cannot be reassigned or redeclared
  • Can only hold scalar values
  • Can hold large high precision numbers
  • Can be created from expression of other constants
  • Can be untyped (Kind)
  • Constants only exist during compilation time

C background

How to run the C program

# cd into the project directory
cd $GOPATH/src/github.com/gophertuts/go-basics/constants/c-vs-go

# compile the program
gcc main.c -o exec

# run the program
./exec

Resources 💎

FEEDBACK ⚗

GopherTuts TypeForm

COMMUNITY 🙌

GopherTuts Discord


Back to Go Basics