#include <stdio.h> #include <stdlib.h> #define __STDC_WANT_LIB_EXT1__ 1 void get_y_or_n(void) { char response[8]; size_t len = sizeof(response); puts("Continue? [y] n: "); if ((gets_s(response, len) == NULL) || (response[0] == 'n')) { exit(0); } puts("You typed y."); } int main(void) { constraint_handler_t oconstraint = set_constraint_handler_s(ignore_handler_s); get_y_or_n(); return 0; }
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课