package Bird_Package is
type Bird_Type is tagged private;
procedure Init(A_Bird : out Bird_Type; Name : in String);
function Name(A_Bird : in Bird_Type) return String;
function
如果我已经定义的阵列型等 type Integer_Array is array(Natural range <>) of Integer;
,还可以使用封装Ada.Containers.Vectors作为 package Integer_Vectors is new Ada.Containers.Vectors(
Element_Type => Integer,
Index
我有程序,它正在阅读的通用包,但我不知道该怎么做关于上下文条款获取数字打印和/或读入从文件。在现在的客户端程序中,我已经知道Element_Type应该是一个整数,但是我所有的声明都是type元素,当没有Ada.Element_text_IO时,我怎么做这件事? 请让我知道,我一直坚持了一段时间。 客户端程序 WITH Ada.Text_IO;
WITH Ada.Integer_Text_IO;
我正在使用Ada进行UDP通信。该代码必须将一些数据发送给另一个将要处理它的主机。我试图发送初始消息来开始通信,但它不起作用。我的客户代码如下: with GNAT.Sockets;
use GNAT.Sockets;
with Ada.Text_IO;
with Ada.Exceptions;
use Ada.Exceptions;
procedure Client_Send is
我试着写下面的程序: with Ada.Text_IO;
procedure Main is
type T is range 0 .. 18;
package IO is new Ada.Text_IO.Integer_IO (T);
begin
IO.Put (1);
end Main;
但是当我尝试编译,我得到以下错误信息: main.adb:
我想遍历数组并检查当前数组索引是否为枚举值。该阵列以及枚举被定义如下: type Option is (None, A, B, C, D);
type Votes is array(Option) of Natural;
Zero_Option_Distribution: constant Votes := (others => 0);
Votes_Distribution: Votes