Reputation: 285
For example, the ifstream function ifstream infile; infile.peek() //returns an integer
Do I need to cast this int return value as a char or can I compare it directly to another char? If the latter is the case, does this mean char to char comparison just checks to see if integer ascii values are the same?
Thanks.
Upvotes: 0
Views: 107
Reputation: 11482
Comparing it with a char literal e.g 'c'
should work due to Integral Promotion
Upvotes: 2