0
4

1 回答 1

0

I have found a fix.

To clear the stream state properly, I had to clear it from both my C++ file with cin.clear(); and within my Assembly file, I cleared the stream by performing:

extern stdin
extern clearerr

mov rax, 0
mov rdi, [stdin]
call clearerr

This made it so I could successfully perform call getchar to grab user input after using CTRL+D to end an input stream.

于 2019-10-22T08:28:32.203 回答