[c++] Funktion "Equals" gibt nur true zurück
Hallo zusammen,
zunächst einmal der Code...
Code:
Mein Problem ist, dass die besagte Stelle im code immer true zurück gibt... Aber warum?
private: System::String^ CreatePalindrom(System::String^ input){
String^ x = input; String^ res = ""; for(int i = 0; i < x->Length; i++){ res = x->Substring(i, 1) + res; } return res; } private: System::Boolean^ IsPalindrom(System::String^ input){ String^ x = CreatePalindrom(input); return (x->Equals(input)); //<-- gibt immer true zurück } Danke im voraus, |
Re: [c++] Funktion "Equals" gibt nur true zurück
Dann lass dir doch mal x und input ausgeben.
|
Re: [c++] Funktion "Equals" gibt nur true zurück
Zitat:
Edit: Fehler gefunden, habe die Funktion falsch aufgerufen:
Code:
geht nicht, musste es umändern in:
if(IsPalindrom(x))//...
Code:
if(IsPalindrom(x)->Equals(true))//...
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:22 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz