Update: I configured the UDP connection in QGroundControl and I think they are atleast communicating now.
In the mavlink help docs it says the following for step 6.)

Inspecting the example C code, this does not exist in the C code. It only prints:
void handle_heartbeat(const mavlink_message_t* message)
{
mavlink_heartbeat_t heartbeat;
mavlink_msg_heartbeat_decode(message, &heartbeat);
printf("Got heartbeat from ");
switch (heartbeat.autopilot) {
case MAV_AUTOPILOT_GENERIC:
printf("generic");
break;
case MAV_AUTOPILOT_ARDUPILOTMEGA:
printf("ArduPilot");
break;
case MAV_AUTOPILOT_PX4:
printf("PX4");
break;
default:
printf("other");
break;
}
printf(" autopilot\n");
}
from the terminal where the c example is running, I only see this:

Am I missing something, or is this a newer example than what is in the help docs?