public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* strupr
@ 2002-08-23  8:04 Paul Gignoux
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Gignoux @ 2002-08-23  8:04 UTC (permalink / raw)
  To: 'gcc-help@gcc.gnu.org'

Hello,

is the function strupr() available in a c++ programm and (if yes) what
is the include file ?

thank you.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: strupr
@ 2002-08-23 10:27 Quang Nguyen (Ngo)
  0 siblings, 0 replies; 3+ messages in thread
From: Quang Nguyen (Ngo) @ 2002-08-23 10:27 UTC (permalink / raw)
  To: gcc-help


Paul Gignoux wrote:

> is the function strupr() available in a c++ programm and (if yes) what
> is the include file ?

char * strupr(char *s)
{
	char *tmp = s;
	while (*s)
		*s = toupper(*s++);
	return tmp;
}

--
Quang

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: strupr
       [not found] <616BE6A276E3714788D2AC35C40CD18D7A4EA3@whale.softwire.co.uk>
@ 2002-08-23  8:43 ` Rupert Wood
  0 siblings, 0 replies; 3+ messages in thread
From: Rupert Wood @ 2002-08-23  8:43 UTC (permalink / raw)
  To: 'Paul Gignoux'; +Cc: gcc-help

Paul Gignoux wrote:

> is the function strupr() available in a c++ programm and (if yes) what
> is the include file ?

This depends upon your C library and not your compiler. If you're using
a unix system, try 'man strupr'.

However, as far as I can see, it's not defined on Solaris or Linux, or
in the C standard or in libiberty. I think it's a Microsoft invention,
sorry.

You can implement it yourself by scanning the string and using toupper()
- or, if you're only working in ASCII, by adding/subtracting 'a'-'A' =
32 for 'a'<=char<='z'. If you've got a Visual C++ install at hand then
you can see how they do it in crt\src\strupr.c, but beware that they use
OS-specific locale functions and globals.

Rup.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-08-23 17:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-23  8:04 strupr Paul Gignoux
     [not found] <616BE6A276E3714788D2AC35C40CD18D7A4EA3@whale.softwire.co.uk>
2002-08-23  8:43 ` strupr Rupert Wood
2002-08-23 10:27 strupr Quang Nguyen (Ngo)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).