You're trying to use strcmp without including the header (cstring) and in the function save_data you're returning the address of something that is destroyed as soon as the function ends, so you're returning the address of something that no longer exists.