Probleme d'exécution

hold_on -  
 hold_on -
PROGRAM tautogramme;
USES WINCRT;
VAR
ch:string;

function tauto(ch:string):boolean;
var
pc:char ;
i:integer;
t:boolean;
begin
pc:=upcase(ch[i]);
t:=true;
i:=1;
repeat
i:=i+1;
if(ch[i]=' ') then
if(i+1<=length(ch))then
if(upcase(ch[i+1])<>pc)then
t:=false;
until(t=false)or(i=length(ch)-1);
tauto:=t;
end;


BEGIN
readln(ch);
if tauto(ch)then
write('tautogramme')
else
write('non tautogramme');
END.

tauto caused a stack fault in module tauto.Exe at 0001:00:29 qui peut m'aidez ??

1 réponse

KX Messages postés 16761 Date d'inscription   Statut Modérateur Dernière intervention   3 020
 
begin
pc:=upcase(ch[i]); 

Que vaut i ? La valeur peut-être n'importe quoi !
1
hold_on
 
vous avez raison , merci bien :)
0
hold_on
 
et comment faire pour transferer cette fonction en une autre récursive
0