Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > stricmp() versus strcasecmp(

Reply
Thread Tools

stricmp() versus strcasecmp(

 
 
ahso
Guest
Posts: n/a
 
      11-25-2009
Hi
i've several functions like:

if (stricmp (p, ".PBM") == 0) {

How should i convert them for Linux?
Many thanks
Michael Sgier
 
Reply With Quote
 
 
 
 
Vladimir Jovic
Guest
Posts: n/a
 
      11-25-2009
ahso wrote:
> Hi
> i've several functions like:
>
> if (stricmp (p, ".PBM") == 0) {
>
> How should i convert them for Linux?



This should be platform independent:
http://www.cppreference.com/wiki/c/string/strcmp


--
ultrasound www.ezono.com
 
Reply With Quote
 
 
 
 
ahso
Guest
Posts: n/a
 
      11-25-2009
Many thanks now I've something similar:

//---Convert texture name in upper case --Compute texture type
------
_strupr_s(tn,TC_TEXTURE_NAME_DIM);

strupr....on Linux?
Many thanks again
Michael
 
Reply With Quote
 
Vladimir Jovic
Guest
Posts: n/a
 
      11-25-2009
ahso wrote:
> Many thanks now I've something similar:
>
> //---Convert texture name in upper case --Compute texture type
> ------
> _strupr_s(tn,TC_TEXTURE_NAME_DIM);
>
> strupr....on Linux?


Just use functions from this list:
http://www.cplusplus.com/reference/clibrary/cstring/
and you are safe.

For linux specific, I am using this:
www.die.net


--
ultrasound www.ezono.com
 
Reply With Quote
 
BGB / cr88192
Guest
Posts: n/a
 
      11-25-2009

"ahso" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
> i've several functions like:
>
> if (stricmp (p, ".PBM") == 0) {
>
> How should i convert them for Linux?


common ways:
write your own;
use macros to replace between stricmp and strcasecmp as needed...


> Many thanks
> Michael Sgier



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Mozilla versus IE versus Opera versus Safari Peter Potamus the Purple Hippo Firefox 0 05-08-2008 12:56 PM
equal? versus eql? versus == versus === verus <=> Paul Butcher Ruby 12 11-28-2007 06:06 AM
Certification - MCP versus MCSA versus MCSE =?Utf-8?B?Q2FuYWRhX0d1eU0=?= Microsoft Certification 1 08-24-2006 06:33 PM
script versus code versus ? Russ ASP .Net 1 06-10-2004 03:06 AM
HTML Client Control versus. HTML Server Control versus. Web Server Control Matthew Louden ASP .Net 1 10-11-2003 07:09 PM



Advertisments