Stránka: 1 z 1
| [ Príspevkov: 7 ] | |
| Autor | Správa |
|---|
Registrovaný: 14.12.08 Prihlásený: 08.01.09 Príspevky: 13 Témy: 3 | 3 |
neviem preco mi vypisuje chybu pri in, mozete mi prosim pomoct
Kód: procedure spoluhlasky (pole:typpole; var vystup:typpole); var i:integer; ret:string; begin for i:=1 to 100 do begin ret:=pole[i]; if not ret[1] in ['a','A','e','E','i','I','o','O','u','U''y','Y'] then vystup:=pole[i]; else vystup:=' ' end; end;
|
|
Registrovaný: 30.04.08 Prihlásený: 03.12.25 Príspevky: 884 Témy: 3 | 3 |
Chyba ti tam ciarka.
['a','A','e','E','i','I','o','O','u','U','y','Y']
_________________ Empty your memory, with a free()… like a pointer! If you cast a pointer to an integer, it becomes the integer, if you cast a pointer to a struct, it becomes the struct… The pointer can crash…, and can overflow… Be a pointer my friend… |
|
Registrovaný: 14.12.08 Prihlásený: 08.01.09 Príspevky: 13 Témy: 3 | 3 |
aj tak mi ju tam vypisuje
|
|
Registrovaný: 30.04.08 Prihlásený: 03.12.25 Príspevky: 884 Témy: 3 | 3 |
Myslim, ze toto by malo byt uzatvorkovane
Kód: if not (ret[1] in ['a','A','e','E','i','I','o','O','u','U''y','Y']) then ...
(co vsak nie je syntakticke chyba).
Co konkretne ti vypisuje? Ake hlasenie? Je mozne, ze chyba je niekde v zvysku zdrojaku (napr. v type "typpole"). Posli sem zdrojak... 
_________________ Empty your memory, with a free()… like a pointer! If you cast a pointer to an integer, it becomes the integer, if you cast a pointer to a struct, it becomes the struct… The pointer can crash…, and can overflow… Be a pointer my friend… |
|
Registrovaný: 14.12.08 Prihlásený: 08.01.09 Príspevky: 13 Témy: 3 | 3 |
ak ju urobim takto, mi nevypise ziadnu chybu, ale vobec mi nic ani nerobi
procedure spoluhlasky (pp:typpole; var vystup:string);
var i:integer;
retazec:string;
begin
vystup:='';
for i:=1 to 100 do
begin
retazec:= pp[i];
if retazec[1] in ['a','e','i','o','u','y','A','E','I','O','U','Y']
then vystup:=' '
else vystup:=pp[i];
end;
end;
neviete co mam na tom zle
|
|
Registrovaný: 30.04.08 Prihlásený: 03.12.25 Príspevky: 884 Témy: 3 | 3 |
Mozes to spravit aj jednoduchsie, staci dat len
Kód: for i:=1 to 100 do begin if (pp[i, 1] in ['a','e','i','o','u','y','A','E','I','O','U','Y']) then {vystup} end;
Skus si do toho pola dat len retazce, ktore zacinaju na samohlasku. Potom by ti ich malo vsetky vypisat... 
_________________ Empty your memory, with a free()… like a pointer! If you cast a pointer to an integer, it becomes the integer, if you cast a pointer to a struct, it becomes the struct… The pointer can crash…, and can overflow… Be a pointer my friend… |
|
Registrovaný: 14.12.08 Prihlásený: 08.01.09 Príspevky: 13 Témy: 3 | 3 |
uz som na to prisla to else som dala prec a dala tam write
|
|
Stránka: 1 z 1
| [ Príspevkov: 7 ] | |
|