You have to create a new object using sys_malloc. Then from the memory it is saved.
Then to call the information back you just recall it back from main and it will reset the info that was saved and populate the members of struct.

Code:
typedef struct PERSO{
	
	int age;
	char* name;
	char* nickname;
	
} PERSO;

PERSO* Person;

PERSO* new_person()
{
	PERSO* new = sys_malloc(sizeof(PERSO));
	memset(new,0,sizeof(PERSO));
	new->nickname = "Toto_2"; // test name
	new->age = 18;	
	
	add_struct(new,sizeof(PERSO));
	return new;
}

void main()
{
Person = new_person(); //
}



Last edited by paracharlie; 03/21/11 01:06.

A8 Commercial