ipkiss
ipkiss

Reputation: 13651

Question about getchar() in C?

I am learning and reading a C book. In the book, they say: "getchar() retrieves a single character from the standard input stream buffer without translating the input. "

I do not understand what the author mean by saying "without translating the input". I have tried googling, bu no luck.

Thanks.

Upvotes: 0

Views: 215

Answers (2)

Himadri Choudhury
Himadri Choudhury

Reputation: 10353

I guess it means that whatever you get in the input stream is what you will get from the getchar() call. There is no automatic conversion, or any changes done. Perhaps also it means that the input is also not modified, for example if the input stream is a file.

Upvotes: 0

Shamim Hafiz - MSFT
Shamim Hafiz - MSFT

Reputation: 22064

Perhaps the author means that, characters are read as characters and not converted to some other data types. For example, if you used scanf("%d"), sequence of digits will be converted to an integer value.

Upvotes: 2

Related Questions