Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 03/06/26 07:18
zorro with ccxt?
by opm. 03/03/26 03:17
WFO Training with parallel cores Zorro64
by Martin_HH. 02/26/26 16:03
Zorro version 3.0 prerelease!
by TipmyPip. 02/25/26 16:38
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (AndrewAMD, TipmyPip), 4,899 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
the1, alx, ApprenticeInMuc, PatrickH90, USER0328
19200 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Strukt vars and vectors #284655
08/14/09 12:36
08/14/09 12:36
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Puppeteer Offline OP
Expert
Puppeteer  Offline OP
Expert

Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
This doesnt work...
Why?
Quote:

typedef struct
{
var testvar;
} teststrukt;

function test(VECTOR* testvec, teststrukt* bla)
{
(bla->testvar)=testvec[1];
}


Thank you =)

EDIT:
(bla->testvar)=testvec.y;
works

Last edited by Puppeteer; 08/14/09 13:56.

Formally known as Omega
Avatar randomness by Quadraxas & Blade
http://omegapuppeteer.mybrute.com
Re: Strukt vars and vectors [Re: Puppeteer] #285113
08/17/09 08:34
08/17/09 08:34
Joined: Apr 2009
Posts: 33
Germany
B
Bunsen Offline
Newbie
Bunsen  Offline
Newbie
B

Joined: Apr 2009
Posts: 33
Germany
Hello Puppeteer,

"testvec[1]" means the second element of type "VECTOR" within an array of vectors.
You can't assign the content of a "VECTOR" struct (size = sizeof(VECTOR))
to a var typ (size = sizeof(var)).

Re: Strukt vars and vectors [Re: Puppeteer] #285116
08/17/09 08:43
08/17/09 08:43
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Vectors are no longer an array of vars, they are just structurally like one.
You MUST use x,y,z with Vectors in lite-c

BUT, you MIGHT be able to do it with (untested)
(bla->testvar)=((var*)testvec)[1];
if you REALLY want to add the extra typing....

You may also be able to use
function test(var* testvec, teststrukt* bla)
...
If the function isnt "overload"ed.

Neither of these ideas are tested.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

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