Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AemStones, AndrewAMD, gamers, Kingware), 1,679 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 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 | chip programmers | 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