Hi,
For some reason I am blanking this Friday morning. I have a class
constructor call Point as shown below. Trying to figure out how I can
make the arguments passed in all upper case before I set the member
variables.
Thanks for the insight.
RishiD
Point(const char* name,
const char* description,
const char* iomid,
const char* address,
const char* type,
Event* event)
{
m_strName = name;
m_strDesc = description;
m_strAddress = address;
m_strType = type;
m_strParentName = iomid;
m_Event = event;
} 13 23583
RishiD <ri****@gmail.comwrote:
For some reason I am blanking this Friday morning.
Starting with posting code that seems a little like C++ to
comp.lang.c? (It has indeed been a lengthy week.)
I have a class
constructor call Point as shown below. Trying to figure out how I can
make the arguments passed in all upper case before I set the member
variables.
There's no builtin C function to do this, but you could write one
using the builtin toupper() for characters. Alternatively, there
might be a C++ way to do this, if you are indeed writing C++ as it
seems.
--
C. Benson Manica | I *should* know what I'm talking about - if I
cbmanica(at)gmail.com | don't, I need to know. Flames welcome.
RishiD said:
Hi,
For some reason I am blanking this Friday morning. I have a class
constructor call Point as shown below.
....which makes me think you're using C++, so I've cross-posted this
reply to comp.lang.c++, and set followups to that group.
Trying to figure out how I can
make the arguments passed in all upper case before I set the member
variables.
In C, you'd probably write a function that calls toupper() in a loop -
but in C++ there may be a more C++y way to do it.
[Remainder of your article retained, for clc++'s convenience. Hi guys,
long time no see.]
>
Thanks for the insight.
RishiD
Point(const char* name,
const char* description,
const char* iomid,
const char* address,
const char* type,
Event* event)
{
m_strName = name;
m_strDesc = description;
m_strAddress = address;
m_strType = type;
m_strParentName = iomid;
m_Event = event;
}
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk
email: rjh at the above domain, - www.
Christopher Benson-Manica wrote:
>RishiD <ri****@gmail.comwrote:
>>... Trying to figure out how I can make the arguments passed in all upper case before I set the member variables.
There's no builtin C function to do this, but you could write one using the builtin toupper() for characters. Alternatively, there might be a C++ way to do this, if you are indeed writing C++ as it seems.
[OT] That would be, surprisingly, the toupper(c) or toupper(begin,end)
services provided in <ctype>
Roberto Waltman
[ Please reply to the group,
return address is invalid ]
RishiD wrote:
Hi,
For some reason I am blanking this Friday morning. I have a class
constructor call Point as shown below. Trying to figure out how I can
make the arguments passed in all upper case before I set the member
variables.
Point(const char* name,
const char* description,
const char* iomid,
const char* address,
const char* type,
Event* event)
{
m_strName = name;
m_strDesc = description;
m_strAddress = address;
m_strType = type;
m_strParentName = iomid;
m_Event = event;
}
#include <ctype.h>
void up(char *q)
{
unsigned char c;
while (*q) { c = *q; *q = toupper(c); q++; }
return;
}
Also your function specifies "const char *". You might want to adhere to that.
Roberto Waltman wrote:
[OT] That would be, surprisingly, the toupper(c) or toupper(begin,end)
^^^^^^^^^^^^^^^^^^
???
Christopher Layne wrote On 02/16/07 11:07,:
Roberto Waltman wrote:
>>[OT] That would be, surprisingly, the toupper(c) or toupper(begin,end)
^^^^^^^^^^^^^^^^^^
???
Go back and read Roberto's message again, this time
paying attention to the text he quoted and responded to.
-- Er*********@sun.com
Christopher Layne wrote:
>Roberto Waltman wrote:
>[OT] That would be, surprisingly, the toupper(c) or toupper(begin,end)
^^^^^^^^^^^^^^^^^^
Off-topic, wearing a C++ hat:
From Josuttis "The C++ Standard Library", 1st ed, 10th printing, page
716.
The facet ctype is a template class parameterized with a character
type...
....
Table 14.16. Services defined by the ctype<charTFacet
....
ct.toupper(beg,end) Converts each letter in the range between beg and
end by replacing the letter with the result of toupper()
Roberto Waltman
[ Please reply to the group,
return address is invalid ]
Eric Sosman wrote:
Christopher Layne wrote On 02/16/07 11:07,:
Roberto Waltman wrote:
>[OT] That would be, surprisingly, the toupper(c) or toupper(begin,end)
^^^^^^^^^^^^^^^^^^
???
Go back and read Roberto's message again, this time
paying attention to the text he quoted and responded to.
The C++ part? toupper(begin,end) is new to me if it's valid at all,
regardless of which language is used.
Eric Sosman wrote:
Christopher Layne wrote On 02/16/07 11:07,:
Roberto Waltman wrote:
>[OT] That would be, surprisingly, the toupper(c) or toupper(begin,end)
^^^^^^^^^^^^^^^^^^
???
Go back and read Roberto's message again, this time
paying attention to the text he quoted and responded to.
The C++ part? toupper(begin,end) is new to me if it's valid at all,
regardless of which language is used.
Roberto Waltman wrote:
Christopher Layne wrote:
Roberto Waltman wrote:
[OT] That would be, surprisingly, the toupper(c) or toupper(begin,end)
^^^^^^^^^^^^^^^^^^
[un-snip]
services provided in <ctype>
Off-topic, wearing a C++ hat:
From Josuttis "The C++ Standard Library", 1st ed, 10th printing, page
716.
The facet ctype is a template class parameterized with a character
type...
...
Table 14.16. Services defined by the ctype<charTFacet
...
ct.toupper(beg,end) Converts each letter in the range between beg and
end by replacing the letter with the result of toupper()
Oh, provided by a ctype class, not provided by any <ctypeheader...?
Eric Sosman wrote:
Go back and read Roberto's message again, this time
paying attention to the text he quoted and responded to.
You are correct. I thought he was responding in general, not specifically to
the C++ part. Part of that may be due to the fact that I don't generally
think in any C++ mode while i'm in this NG.
"Harald van D?k" wrote:
>Roberto Waltman wrote:
>... C++ stuff ... ct.toupper(beg,end) Converts each letter in the range between beg and end by replacing the letter with the result of toupper()
Oh, provided by a ctype class, not provided by any <ctypeheader...?
[Still-off-topic] Beginning to get beyond my depth, (no books at hand
now.) I believe it is provided by the standard headers, but somehow
linked to (buried under?) the locale selection mechanisms.
There is also a toupper(c, loc) that will convert c to upper case IFF
it is a lower case character in locale loc.
Roberto Waltman
[ Please reply to the group,
return address is invalid ]
"Christopher Layne" <cl****@com.anodizedwrote in message
news:11************@news-west.n...
RishiD wrote:
>Hi,
For some reason I am blanking this Friday morning. I have a class constructor call Point as shown below. Trying to figure out how I can make the arguments passed in all upper case before I set the member variables.
Point(const char* name, const char* description, const char* iomid, const char* address, const char* type, Event* event) { m_strName = name; m_strDesc = description; m_strAddress = address; m_strType = type; m_strParentName = iomid; m_Event = event; }
#include <ctype.h>
void up(char *q)
{
unsigned char c;
while (*q) { c = *q; *q = toupper(c); q++; }
return;
}
Also your function specifies "const char *". You might want to adhere to
that.
Especially since this can cause bad things to happen using the above code:
char *ptr = "test";
up(ptr);
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Software Reuse Project This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: programmerforhire |
last post by:
Hello all,
Is there a way to setup an ms-access table so that when I enter
text in the 'datasheet' mode, it will automatically be converted
tp...
|
by: Addio |
last post by:
Hello, MSA Group,
Does anyone know how to convert all UPPER CASE text to Initial Caps?
I'm familiar with ucase and lcase, but don't know of any...
|
by: Janice |
last post by:
char* line = "abcd";
How to convert the line to upper case and print?
Any option for printf to do this?
Thanx
|
by: Manish |
last post by:
In my application there is need for only upper case chars..
Currently I am making entry to upper case when user leaves focus of the
text control....
|
by: Mariame |
last post by:
Hi Everyone,
Is There a way to eliminate upper case, so the user could only write Lower
Case or to transfer the Upper Case String to lower case in...
|
by: Eric Lindsay |
last post by:
Should HTML 4.01 Strict markup be done in upper case or in lower case?
I understand that HTML allows either upper or lower case. I also notice...
|
by: csanjith |
last post by:
Hi, i have a situaion where i need to convert the characters entered in
an text field to upper case using C. The configuration id utf8...
|
by: conan9 |
last post by:
Hi folks,,
I'm new here and having trouble to compile uppercase ....
and here is my code:
#include <iostream>
#include <string>
#include...
|
by: lenniekuah |
last post by:
Hullo Awesome Helpers,
Thank you for helping me earlier.
I am back with new problem. I am trying to covert a TEXT String into either Lower and...
|
by: tammygombez |
last post by:
Hey fellow JavaFX developers,
I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
|
by: tammygombez |
last post by:
Hey everyone!
I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
|
by: better678 |
last post by:
Question:
Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct?
Answer:
Java is an object-oriented...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
by: CD Tom |
last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
|
by: CD Tom |
last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
|
by: jalbright99669 |
last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
| |