Pergunta de entrevista da empresa BDCOM

Explain the difference between TCP and UDP. How would you implement them in C/C++?