开发者

Doubts in ada language

HI all,

I am a beginner in the ada language.I have an short piece of code.Can anyone please tel me what does it mean?

type Myarr_Type is array (Character) of Character;

  Myarr : Myarr_Type;
  C1 : character := character'first;
  C2 : character := character'last;

My question is 1)What does C1 and C2 contain according to the above code?

Please do excuse if this is really silly.I dont have an ada compiler to check the contents of this variable

开发者_开发百科

Regards Maddy


The 'first and 'last attributes of a type indicate the first and last values of the range covered by the type. In this case, C1 is character'val(0) and C2 is character'val(255) (character is an 8-bit character type).

You can read more about these "Language Defined Attributes" in Annex K of the Ada 95 Reference Manual.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜