Platinum Partner

"Unget String" Function

As a complement to ungetc(), this C function pushes a string back onto an input stream, character by character.  It returns the number of characters pushed, or -1 if an error occurred.

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;
}
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}