converting structs to char pointer and converting back works