Read from stdin write to stdout in C

后端 未结 4 713
无人及你
无人及你 2021-02-03 15:55

I am trying to write a cat clone to exercise C, I have this code:

#include 
#define BLOCK_SIZE 512
int main(int argc, const char *argv[])
{
    if         


        
4条回答
  •  [愿得一人]
    2021-02-03 16:44

    i can quote an answer by me: https://stackoverflow.com/a/296018/27800

    fread(buffer, sizeof(char), block_size, stdin);
    

提交回复
热议问题