Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
mirek is currently offline  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

 
Read Message
Read Message
Previous Topic: Conversion hex to int
Next Topic: CHECK macro
Goto Forum:
  


Current Time: Sun Apr 27 13:05:59 CEST 2025

Total time taken to generate the page: 0.00836 seconds