Code Room
Code reviewMediumcr-g157
Subject LifetimesLevel Mid–Senior~20 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

Review this C++ helper that formats an error label.

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.

Talk through your review
Code to reviewcpp
#include <cstdio> const char* label_for(int code) {    char buf[32];    snprintf(buf, sizeof(buf), "err-%d", code);    return buf;} void emit(int code) {    const char* s = label_for(code);    log_line(s);   // some logging sink}
Run or narrate your approach, then ask the coach.