Skip to content

Instantly share code, notes, and snippets.

Kaos-Industries

Block or report user

Report or block Kaos-Industries

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Kaos-Industries
Kaos-Industries / iszero-fast.cpp
Created Dec 1, 2019 — forked from BobVul/iszero-fast.cpp
Check for nonzero data in a stream, quickly and without output. Answers http://superuser.com/q/559772/117590.
View iszero-fast.cpp
#include <cstdio>
#define BUFFER_SIZE 1024
int main() {
FILE* file = stdin;
char buffer[BUFFER_SIZE];
long long bytes_read = 0;
while (bytes_read = fread(buffer, 1, BUFFER_SIZE, file)) {
You can’t perform that action at this time.