Reading a file name from piped command

前端 未结 3 2053
余生分开走
余生分开走 2021-01-16 09:04

So I\'m trying to get the C program to read a filename from the command line in the following format: cat (filename path) | (program name)

i can get it to read the n

3条回答
  •  北恋
    北恋 (楼主)
    2021-01-16 09:25

    To read from the contantenated, you need to read from STDIN

    char c = (char)fgetc(stdin)
    

提交回复
热议问题