Skip to content

Instantly share code, notes, and snippets.

@kamoshi
Created December 13, 2019 15:48
Show Gist options
  • Save kamoshi/591a924a188dd9e717ac9a55d52ea17e to your computer and use it in GitHub Desktop.
Save kamoshi/591a924a188dd9e717ac9a55d52ea17e to your computer and use it in GitHub Desktop.
io
char buffer[12];
while (fgets(buffer, sizeof buffer, input) != NULL)
{
std::string str = "";
char* ptr = buffer;
while (*ptr != NULL)
{
str += *ptr++;
}
std::cout << str;
//fputs(buffer, stdout);
}
fclose(input);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment