void ungets(char* str, FILE* stream) { if (!str || !file) return -1; size_t len = strlen(str); for (int i=len-1; i>=0; i--) if (ungetc(str[i], stream) == EOF) return -1; return len; }
You need to create an account or log in to post comments to this site.