Autor Beitrag
dragi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 88



BeitragVerfasst: Mi 12.05.04 14:14 
Hallo,

ich muss leider Delphi Code nach c++ konvertieren und hab nicht wirklich Ahnung von c++. Weiss hier jemand wie ich z.B.
ausblenden Delphi-Quelltext
1:
if P in ['a'..'z', 'A'..'Z'] then					


in c++ ausdrücken kann?

Vielen Dank

Dragi
mirage228
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 338

Win 7 Prof.
Delphi 2005 Prof., Delphi 2010 Prof.
BeitragVerfasst: Mi 12.05.04 17:47 
Hi,

soweit ich weiss gibt es dieses Konstrukt in C++ nicht. Du musst es wohl oder übel anders übersetzen.
Eventuell gehts nur mit if ... else

mfG
mirage228

_________________
May the source be with you, stranger.
maze2k
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 252

WIN 95, WIN NT 4.0, WIN 98, WIN 98SE, WIN 2000, RedHat Linux 7.3, Mandrake Linux 9.2, Knoppix Linux 3.3
D6 Pers
BeitragVerfasst: Do 13.05.04 09:58 
In C musst du das entweder mit if then else machen, also jedes Zeichen extra, oder du machst es mit den Asciicodes der Zeichen also irgendwie so:

ausblenden Quelltext
1:
2:
if (p > AsciiOf(a) && p < AsciiOf(z)) || (p > AsciiOf(A) && p < AsciiOf(Z))) {
}


wobei AsciiOf keine Funktion von C++ ist, da musst du suchen wie du das machen musst...

Moderiert von user profile iconKlabautermann: Code-Tags hinzugefügt.

_________________
Wer das Konzept der Unendlichkeit verstehen will, muss nur das Ausmaß menschlicher Dummheit betrachten. (Voltaire)
KidPaddle
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 351

WinXP,Linux
D7 Prof, XE7
BeitragVerfasst: Do 13.05.04 18:52 
Solange es sich um alphanumerische Zeichen handelt, kannst Du auch ein Suche in einer Zeichenkette verwenden, also z. B. wie folgt in Delphi:

ausblenden Delphi-Quelltext
1:
2:
  if (Pos(UpperCase(P), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') > 0) then begin
  end;


Gruß
KidPaddle
Nightmare_82
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 260



BeitragVerfasst: So 16.05.04 13:42 
ausblenden Quelltext
1:
2:
3:
if ( (p >= 'a' && p <= 'z') || (p >= 'A' && p <= 'Z') )
{
}

so müsste es gehen, habe allerdings länger kein C mehr programmiert