	the first attempt:
	typedef struct Pet{
    	char* name;
        int legs;
    	char* color;
    } pet;
void writedata(pet *Pet, size_t FIELD){
	char *base;
	char* b;
	base=(char*) Pet;
	char string[50];
	offset=offsetof(Pet, FIELD);
	b=(char *)(base+offset);
	gets(string);

	*b/*(char*)Pet+offsetof(Pet, FIELD)*/ = (char*)malloc(strlen(string)+1);
	strcpy(*b, string);
}
void addpet(pet* Pet, int &TotalLegs){
	puts("Input name\n");
	writedata(Pet, offsetof(Pet, name));//how I actually wanted it to work
	writedata(Pet, offsetof(Pet, color));
___________________________________________________
	
	the second attempt:
	typedef struct Pet{
        char* name;
        int legs;
        char* color;
    } pet;
    void writedata(pet *Pet, size_t FIELD){
        char string[50];
        gets(string);
        (char*)Pet+offsetof(struct Pet, FIELD) = (char*)malloc(strlen(string)+1);
        strcpy((char*)Pet+FIELD, string);
    }
	