Skip to content

Instantly share code, notes, and snippets.

@fritz0705
Created October 26, 2012 17:41
Show Gist options
  • Select an option

  • Save fritz0705/3960161 to your computer and use it in GitHub Desktop.

Select an option

Save fritz0705/3960161 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#define WINDOW 32
int main()
{
int i;
int32_t in[WINDOW] = {0};
while (1)
{
for (i = 0; i < WINDOW - 1; ++i)
in[i] = in[i + 1];
if (read(0, &in[WINDOW - 1], sizeof(int32_t)) <= 0)
break;
printf("[");
for (i = 0; i < WINDOW; ++i)
printf("%d, ", in[i]);
printf("]\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment