Ada

types and subtypes

Ada

type Hours24 is new Integer range 0 .. 23; type Hours is new Integer range 1 .. 12; Hours24 and Hours are different types. You can not assignment Hours's var to Hours24 variables. type Hours24 is new Integer range 0 .. 23; subtype Hours is…

hello.adb with Text_IO; use Text_IO; procedure Hello is begin Put_Line("Hello, world"); end Hello; > gnatmake hello 前々からコードは読んでいたけど、コンパイルの仕方がわからなかった。 gnatmakeを使うと簡単に出来るらしい。ファイル名は拡張子 .…