Gamestudio Links
Zorro Links
Newest Posts
Missing PnL files in zOpen child processes
by DonQuijote. 10/19/26 11:11
ZorroGPT
by TipmyPip. 10/15/26 08:28
Alternative to Stooq for Zorro S
by Petra. 10/14/26 07:04
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (ratz, AndrewAMD), 6,921 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
JimSimons, julienp, julienper, KelleyAbbey, Yopachi
19246 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: 603
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 603
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