Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 03/20/26 07:00
Black Book, 4th edition
by jcl. 03/17/26 09:28
Trying to get started...
by Lukudo. 03/16/26 09:08
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (TipmyPip, vince, AndrewAMD), 4,051 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
mredit, vestriaa, Lukudo, mldenoiser, the1
19204 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How can I directly access to a char of a string? [Solved] #240239
12/10/08 07:39
12/10/08 07:39
Joined: Jul 2008
Posts: 23
Turkey
H
Hatean Offline OP
Newbie
Hatean  Offline OP
Newbie
H

Joined: Jul 2008
Posts: 23
Turkey
I want to make some changes on a string and I have to access chars of that string. I tried _str and _chr but they are making so many stupid problems. Can't I access directly to chars in a string?

Note: I also tried "myString.chars[2]" but it doesn't work...

Thanks for helping...

Last edited by Hatean; 12/12/08 11:34.

The Life Game is disgustingly bad but the graphics and reality are extremely cool...
Re: How can I directly access to a char of a string? [Re: Hatean] #240292
12/10/08 12:18
12/10/08 12:18
Joined: Apr 2008
Posts: 600
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 600
Austria
When you want to access single chars, (myString.chars)[i] is the right way. For the whole char array, use _chr(myString).

STRING* str = "12345";

function main()
{
printf("%x",(str.chars)[2]);
}

should give you 33, which is the character "3" in hex.

Re: How can I directly access to a char of a string? [Re: Petra] #240367
12/10/08 16:47
12/10/08 16:47
Joined: Jul 2008
Posts: 23
Turkey
H
Hatean Offline OP
Newbie
Hatean  Offline OP
Newbie
H

Joined: Jul 2008
Posts: 23
Turkey
It's working! I was using it wrong then. I m glad for your help. Thanks!


The Life Game is disgustingly bad but the graphics and reality are extremely cool...

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1