Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 03/28/26 14:01
TMFs on options in live trading
by Spirit. 03/26/26 19:52
TDAmeritrade plugin with new Schwab accountt?
by AndrewAMD. 03/24/26 17:11
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
1 registered members (TipmyPip), 6,037 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
mredit, vestriaa, Lukudo, mldenoiser, the1
19204 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Structs and digits #152661
09/08/07 01:53
09/08/07 01:53
Joined: Sep 2007
Posts: 14
X
xykynan Offline OP
Newbie
xykynan  Offline OP
Newbie
X

Joined: Sep 2007
Posts: 14
I'm relatively new to programming, so please bear with me if this is a dumb question.

I have the following code:


typedef struct
{
STRING* name;
} TEST;

TEST* junk =
{
name = "aaa";
}

PANEL* new =
{
layer = 1;
red = 100;
blue = 100;
green = 100;
size_x = 400;
size_y = 400;
flags = VISIBLE | LIGHT;
digits (10, 10, 4,*, 1, junk.name);
}

I was hoping it would print the string "aaa", but instead it just gave me numbers.

Thanks in advance.

Re: Structs and digits [Re: xykynan] #152662
09/08/07 06:54
09/08/07 06:54
Joined: Aug 2000
Posts: 1,141
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,141
Baunatal, Germany
Yeah that code makes no much sense. The panel is ok but how you set up that "TEST*" struct looks very wrong.

You can define a string this way

STRING* name = "aaa";

or in the code, this way

junk.name = str_create("aaa");

but certainly not

TEST* junk =
{
name = "aaa";
}

because "aaa" is a char[] array and not a STRING.

Re: Structs and digits [Re: Tobias] #152663
09/08/07 11:50
09/08/07 11:50
Joined: Sep 2007
Posts: 14
X
xykynan Offline OP
Newbie
xykynan  Offline OP
Newbie
X

Joined: Sep 2007
Posts: 14
Thank you very much!


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