if (ret == 2) printf("Name: %s, Age: %d\n", name, age); free(name); // %as requires manual free
int ret = sscanf2(input, "%as %d", &str, &num); if (ret < 0) fprintf(stderr, "sscanf2 error: %s\n", sscanf2_strerror(ret)); // e.g., "Format string error at position 3" sscanf2
int sscanf2_s(const char *str, size_t str_max, const char *format, ...); For this guide, we define: if (ret == 2) printf("Name: %s, Age: %d\n",