ProbIem with EOF in C

后端 未结 7 878
既然无缘
既然无缘 2021-01-01 03:48

I\'m writing a program which is supposed to read two strings that can contain line breaks and various other characters. Therefore, I\'m using EOF (Ctrl-Z or Ctrl-D) to end t

7条回答
  •  太阳男子
    2021-01-01 04:11

    I run the code on my linux box, here is the result:

    Enter a: qwer
    asdf
    Enter b: 123
    456
    
    Results:
    a: qwer
    asdf
    b: 123
    456
    

    Two Ctrl-D was needed because the terminal input buffer was not empty.

提交回复
热议问题