Gamestudio Links
Zorro Links
Newest Posts
NOMAX undeclared identifier.
by qin. 01/09/26 00:20
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 01/07/26 15:14
Zorro locks DLL
by jcl. 01/07/26 13:33
zorro with ccxt?
by qin. 01/07/26 07:50
The new evaluation system
by jcl. 01/05/26 08:50
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (Quad, 1 invisible), 3,552 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Namitha_NN, Syndrela, agasior, mosfet, MonsterX
19188 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
struct - copy content #150519
08/27/07 13:54
08/27/07 13:54
Joined: Jul 2006
Posts: 150
Deutschland/Germany, nahe Hamb...
dennis Offline OP
Member
dennis  Offline OP
Member

Joined: Jul 2006
Posts: 150
Deutschland/Germany, nahe Hamb...
Hi!

I want to copy the content of Tree1 to Tree2....how can I do this?

"
typedef struct
{

var Alter;
var Zustand;
STRING* Name;

}TREE;

TREE Tree1;
TREE Tree2;

"

Re: struct - copy content [Re: dennis] #150520
08/27/07 14:28
08/27/07 14:28
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
It's as easy as:
Code:
memcpy(&Tree2,&Tree1,sizeof(Tree1));


Alternatively you can of course copy it variable by variable. Be carefull, the string won't be copied. Just the pointer to the string will be copied.


Always learn from history, to be sure you make the same mistakes again...

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