networking · beginner · ~15 min
Format a connection endpoint string.
Implement int build_endpoint(char *out, int outsz, const char *host, int port) writing "host:port" into out and returning its length (use snprintf).
#include <stdio.h>
int build_endpoint(char *out, int outsz, const char *host, int port) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.