Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include <cstdio>
- int puts(const char *s)
- {
- FILE *pFile;
- int result = 0;
- static int callCount = 0;
- pFile = fopen("./puts.log", "w");
- fprintf(pFile, "%d\n", ++callCount);
- while (*s)
- {
- if (putchar(*s++) == EOF) return EOF;
- ++result;
- }
- if (putchar('\n') == EOF) return EOF;
- fclose(pFile);
- return ++result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement