Précédent   Forum du club des développeurs et IT Pro > Autres langages > Autres langages > Ada
Ada Forum d'entraide sur la programmation en langage Ada
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 27/12/2012, 13h01   #1
toetoe
Invité de passage
 
unknown unknown
Inscription : décembre 2010
Messages : 5
Détails du profil
Informations personnelles :
Nom : unknown unknown

Informations forums :
Inscription : décembre 2010
Messages : 5
Points : 0
Points : 0
Par défaut probleme : les tableaux en ada

bonjour,
j'aimerais savoir pourquoi ce code ne fonctionne pas

procedure prog is

b : array(5..9) of Integer :=(5,6,7,8,9);
a : array(5..9) of Integer ;

begin
a := b ;
end prog;

merci d'avance
toetoe est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/12/2012, 16h47   #2
Amnael
Invité de passage
 
Homme
Étudiant
Inscription : août 2011
Messages : 30
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : août 2011
Messages : 30
Points : 2
Points : 2
Tu dois commencer par définir le type de ton tableau.


Type NomDuType is array In integer 5..9 of Integer;

ET ensuite tu déclares la variable de ton type que tu as crées.

maVariable:NomDuType;
Amnael est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/12/2012, 21h17   #3
Zerte
Membre régulier
 
Mathématicien
Inscription : mars 2012
Messages : 58
Détails du profil
Informations personnelles :
Localisation : Suisse

Informations professionnelles :
Activité : Mathématicien
Secteur : Finance

Informations forums :
Inscription : mars 2012
Messages : 58
Points : 82
Points : 82
Citation:
Envoyé par toetoe Voir le message
j'aimerais savoir pourquoi ce code ne fonctionne pas
En fait il ne compile même pas - nuance.
ça ira mieux comme ça:

Code :
1
2
3
4
5
6
7
8
9
10
procedure prog is

  type Int_array is array(Integer range <>) of Integer;

  b : Int_array(5..9):= (5,6,7,8,9);
  a : Int_array(5..9);

begin
  a := b;
end prog;
Zerte est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 18h22.


 
 
 
 
Partenaires

Hébergement Web