Code Room
Code reviewMedium
Question
Review this C function that builds a greeting string on the heap.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
char *greet(const char *name) { size_t n = strlen(name); char *out = malloc(n); // room for the name sprintf(out, "Hi, %s!", name); // write greeting return out;}Run or narrate your approach, then ask the coach.