I am trying to print an integer in Ada83 .All the web sites have the info regarding Ada95 way of printing i.e Integer_Text_IO.Put (C); but this does not get compiled in Ada83. How Do I print an Integer in Ada83(Its a course requirement )?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Integer_Text_IO
is an instantiation of Integer_IO
, provided in the standard library in Ada 95.
In Ada 83, the generic package Integer_IO
exists; you just have to instantiate it yourself.
(You can also use Integer'Image
, but that adds an annoying leading space for non-negative values.)
(I'm not going to show code because you say it's a school assignment.)