Home » U++ Library support » U++ Core » strcmp() works with String?
|
Re: strcmp() works with String? [message #5907 is a reply to message #5906] |
Tue, 24 October 2006 12:04  |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
forlano wrote on Tue, 24 October 2006 04:48 | Hello,
yesterday I noticed in my code several instructions:
String s1, s2;
strcmp(s1, s2);
I used it when I ported in U++ the old C code and was unaware of the method CompareNoCase(). The question is: strcmp() maybe armful with String? Are there case in which the operation can produce the crash? Anyway I'm going to substitute it.
Luigi
|
Actually, it is more or less harmless and String is designed to work this way, as it has conversion operator to const char * (this is BTW a big difference from std::string too). You can use String everywhere const char* is required.
Mirek
[Updated on: Tue, 24 October 2006 12:05] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun Apr 27 12:44:46 CEST 2025
Total time taken to generate the page: 0.00649 seconds
|