本文介绍了是什么导致此Ada编译错误“模糊字符文字”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个Ada代码。

with Ada.Text_IO;
use Ada.Text_IO;

procedure for_Loop is
begin
    for Counter in 'A'..'Z' loop
        Put(Counter);
    end loop;
    New_Line;
end for_Loop;

Ada编译器(gnatmake)输出这些错误消息。

The Ada compiler (gnatmake) outputs these error message.

gcc -c for_loop.adb
for_loop.adb:6:24: ambiguous character literal
for_loop.adb:6:24: possible interpretation: Character
for_loop.adb:6:24: possible interpretation: Wide_Character
for_loop.adb:6:24: possible interpretation: Wide_Wide_Character
gnatmake: "for_loop.adb" compilation error

代码有什么问题?

推荐答案

来自:



with Ada.Text_IO;
use Ada.Text_IO;

procedure for_Loop is
begin
    for Counter in Character range 'A'..'Z' loop
        Put(Counter);
    end loop;
    New_Line;
end for_Loop;

这是赔率:

ABCDEFGHIJKLMNOPQRSTUVWXYZ

这篇关于是什么导致此Ada编译错误“模糊字符文字”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 11:57