打印记录元素字符串时抛出错误?

时间:2014-11-25 16:59:50

标签: record ada

使用put打印记录元素字符串时抛出错误为什么请帮助我理解?

 with ada.text_io;
 use ada.text_io;

procedure main is
  type my_rec is record
    name:string(1..5)of integer; 
  end record;
var:my_rec;

begin
var.name:="hello";
put(var.name); -- why error?
end main;

错误信息在

之下
 cc -c hello.adb                                                                
 hello.adb:7:27: missing ";"                                                     
 gnatmake: "main.adb" compilation error  

1 个答案:

答案 0 :(得分:0)

hello.adb:7:27是错误的坐标,所以看看" hello.adb"在第7行,第27位。

相关问题