Bonjour , j'ai un petit soucis , j'ai écrit un programme qui quand je tape une valeur au clavier me retourne son image par une fonction , , par exemple si je tape 1 , mon programme me retourner 2*1 - 3 , soit -1 , mais il compile pas , regardez :
le message d'erreur est :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 program mafonction; function toto(const x: INTEGER; const y: INTEGER):INTEGER; begin y = 2*x - 3; writeln(y); end; begin readln(x); toto(y); end.
etrange tout ceci non ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 $ fpc fonction.pas Free Pascal Compiler version 2.0.4 [2006/08/20] for i386 Copyright (c) 1993-2006 by Florian Klaempfl Target OS: Linux for i386 Compiling fonction.pas fonction.pas(5,12) Error: Illegal expression fonction.pas(11,8) Error: Identifier not found "x" fonction.pas(11,10) Error: Illegal expression fonction.pas(12,10) Error: Identifier not found "y" fonction.pas(15) Fatal: There were 4 errors compiling module, stopping fonction.pas(15) Fatal: Compilation aborted
merci
Partager