Another round of "could replace googling" for ChatGPT: This all seems correct at a glance (I didn't actually check that they ran), but I've done these hundreds of times already. Might be missing some linker flags, though.