c++ - Wide character and character in assignment and equality operators -


suppose wc wchar_t , c char.
1) there different between these 2 assignments?

c = 'a'; wc = l'a'; 

2) there rule force equality of c , wc ascii values? mean wc == c compiler?

no -- standard guarantees both basic execution character set , basic wide execution character set contain 'a', not guarantee have same value in both.

§2.3/3 gives few restrictions (e.g., digits shall consecutive), none of applies here, , final: "the values of members of execution character sets , sets of additional members locale-specific."

so, not not guaranteed, @ least in theory change when/if change locale.


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -