This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Working w/ strings (again)


Working w/ strings (again)

Postby egarayblas » Oct 27, 2003 @ 12:06am

-- home of the think & tap games!
User avatar
egarayblas
pm Insider
 
Posts: 627
Joined: Sep 14, 2002 @ 1:50am
Location: Philippines


Postby fzammetti » Oct 27, 2003 @ 12:57am

In answer to your first question:

for (int i = 0; i < 8; i++) {
displayChar(temp[i]);
}

whre displayChar is whatever function you will use to plot. The main point is that TCHAR's can be accessed just like an array of char's (actually, I might have the data type wrong here, but it's just an array, that's the point).

For the second, check out strncpy. It's not exactly the same as mid, but you should be able to just specify a pointer to the character position in your string to start copying at, and then the proper length, and you should be able to get the same effect. There is a wide-character version as well, which is probably what you need.

The answer to your third question, unless I'm missing something, is just cast to char. I believe doing (char)65 will do what you want, but how you intent to use it will probably make a difference. Putting it into a string perhaps? Something like:

TCHAR temp[5] = TEXT("1234");
temp[3] = (char)65;

I'm pretty sure that will work. Actually, I'm not even sure you need to bother casting it.
...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby superman » Oct 27, 2003 @ 1:08am

"Kittens give Morbo gas." - Morbo the News Monster
User avatar
superman
pm Member
 
Posts: 99
Joined: Nov 3, 2001 @ 1:09am


Postby damian » Oct 27, 2003 @ 2:21am

damian
pm Insider
 
Posts: 3960
Joined: Sep 3, 2002 @ 7:59pm
Location: Acton, MA (home), NYC (school)


Postby mlepage » Oct 27, 2003 @ 6:34am

www.scalenesoftware.com
Great games for your Palm and Pocket PC!
User avatar
mlepage
pm Insider
 
Posts: 1050
Joined: Aug 3, 2003 @ 4:47am
Location: Canada


Postby Dan East » Oct 27, 2003 @ 12:46pm

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby egarayblas » Oct 27, 2003 @ 4:09pm

-- home of the think & tap games!
User avatar
egarayblas
pm Insider
 
Posts: 627
Joined: Sep 14, 2002 @ 1:50am
Location: Philippines


Postby Dan East » Oct 28, 2003 @ 2:53am

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby mlepage » Oct 28, 2003 @ 5:13am

www.scalenesoftware.com
Great games for your Palm and Pocket PC!
User avatar
mlepage
pm Insider
 
Posts: 1050
Joined: Aug 3, 2003 @ 4:47am
Location: Canada


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron