Code Room
Code reviewMedium
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.
Learn the concepts
#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.