Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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