I have made two simple programs :
out.c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
int x;
srand((unsigned int)time(NULL));
for(;;)
{
x = rand();
printf("%d\n", x % 100);
sleep(1);
}
return 0;
}
in.c
#include <stdio.h>
int main()
{
int x;
for(;;)
{
scanf("%d",&x);
printf("%d\n", x);
}
return 0;
}
I am running it like ./out | ./in
, but i am not getting any print. What's the correct way to run in such a way as to pipeline the inputs